4

We had understood, MSIX is an interesting, modern alternative to ClickOnce. Using with GUI runs smoothly. And we want also to use it with Powershell/CMD scripts. (We only want the msix package, no store upload.)

Here is our problem. I have seen the doc from MS (https://learn.microsoft.com/en-us/windows/msix/package/manual-packaging-root) but it is very partial. I have no special with to do, I only want to make the standard export by script instead of GUI.

Please, can anybody give me a better instruction/tutorial to easy create an msix-Package by command line?

Here the steps, I found - and partial questions:

  1. Create Manifest.xml - Good documentation of the content, but where to save it? I use the folder with the *.sln
  2. Generate a Package Resource Index - I find the MakePRI.exe, but hot to use?
  3. Create the package with MakeAppx - who and where to use? Even in standard case I need a mapping.txt. Which files must it contain? All from Manifest? Where I must place the files - Server online or local at PC? Only pictures for icons? Where I must run it? Must it the place with the *.sln or can it be a subfolder? Where have the binaries of my program to be?
  4. Create an app bundle - What must stand in the mapping file here, when I will an app for x86 and x64?
  5. Sign msix - sounds easy - give msix-file and signature as parameter and run

You see, I am very confused. With GUI - MSIX creation is easy. But how to automate it? Can someone help me?

Ian Kemp
  • 28,293
  • 19
  • 112
  • 138
Dominik
  • 41
  • 3

1 Answers1

0

It seems to me that you are on the wrong track here, basically, you are trying to reinvent the wheel and create your own tool that builds MSIX packages.

This doesn't sound very effective to me. We (at Advanced Installer) and other vendors, Microsoft including, have been working for years to build reliable MSIX packaging tools, this is not a 1-month project task that you can start from scratch, without any prior domain knowledge.

What I suspect you need is actually a way to build from the command line a project that you created with Visual Studio, Advanced Installer, InstallShield, or any other tool that can build MSIX packages.

So basically, you need to use the GUI to initially build the project that will generate your MSIX and you can then go on to use the options below to build an MSIX from that project using the command line.

If I am wrong, and you actually need a way to build an MSIX package from scratch from the command line, please update the question with more details so the community can better understand what you are trying to accomplish in order to provide you with useful guidance.

TLDR solution:

  1. So, the first step is for you to build your MSIX project using your tool of preference. From your question, it seems you are only using VS, so you need to use the Windows Application Packaging Project.

  2. Now that you got the .SLN which contains your source code for the application along with your MSIX project, all you need to do is to trigger a build from the command line, using msbuild.

Note. If you are using a third-party tool to build your MSIX, then search for it's documentation, all professional tools have a command-line interface. Here is for example how you can build a project from using Advanced Installer's CLI.

Bogdan Mitrache
  • 10,536
  • 19
  • 34
  • What if the app is not building with msbuild but another build system ? What are the steps that should be put on that buildsystem to get a .msix out of, say, an install folder with a .exe and .dlls in it ? – Jean-Michaël Celerier May 20 '22 at 14:38
  • What build system? And what tool are you using the build the MSIX package? If you are using a tool like Advanced Installer you can automate the build in various build systems, here is our full list of integrations: https://www.advancedinstaller.com/installer-continuous-integration.html I assume other tools have similar integrations or at least the option to create and execute a command line script. – Bogdan Mitrache May 23 '22 at 08:24
  • I'm using cmake with ninja, building the msix with makeappx.exe – Jean-Michaël Celerier May 23 '22 at 08:35
  • I don't have experience with ninja or cmake - but what I can tell is that using makeappx.exe is overkill. Try finding a paid solution to build your MSIX and save some time and headaches. Most paid tools have some sort of command line or direct integration/extension to help automate the build. If you prefer OSS tools, check out Wix (but I think their support for MSIX is paid too) https://www.firegiant.com/products/wix-expansion-pack/msix/ – Bogdan Mitrache May 24 '22 at 09:14