How to build an MSIX from comandline

Viewed 816

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://docs.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?

1 Answers

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.

Related