Windows

 Windows App Package: How to Bundle MSIX packages

Bundle MSIX Packages
Bundle MSIX Packages

MSIX is a packaging format and deployment technology for Windows apps. It is meant to replace the older MSI and AppX formats with ones that are more secure and more up-to-date. MSIX packages can be installed and managed through the Microsoft Store for Business and Microsoft Intune. They can be used to distribute both desktop and UWP (Universal Windows Platform) apps. MSIX also includes features like built-in virtualization, which allows apps to run in isolation with reduced permissions, and support for in-place upgrades, which makes it easier to update apps. By putting all the different versions of your installer’s architecture into a single package, you only need to publish the package to the Store or another channel for distribution.

The Windows 10 deployment platform can tell what kind of package “.msixbundle” is and will only download files that match the architecture of your device. Remember that once you’ve decided to bundle and distribute an app as an .msixbundle, you cannot unbundle the app to redistribute it just an MSIX package. Here are other related posts: Windows Package Manager: How to install Winget CLISilent Install: Msiexec.exe Command Line SwitchesWindows Package Manager: How to install applications with Winget CLIHow to install a software package from a source file in Linux and How to clean packages laying around in Linux.

In this article, we’ll show you how to build a bundle after you’ve converted your x86 and x64 Windows installers using MSIX Packaging Tool.

MSIX Key features

  • Reliability: MSIX offers a dependable installation with a success percentage of 99.96% over millions of installations and a guaranteed uninstall.
  • Optimization of network bandwidth: By downloading just the 64k block, MSIX reduces the effect on network capacity. This is accomplished by using the AppxBlockMap.xml file included in the MSIX app package. MSIX is intended for use with modern systems and the cloud.
  • Optimization of disk space: MSIX eliminates file duplication among programs, and Windows handles shared files across apps. Since the applications are remain independent of one another, changes will have no effect on other apps that share the file. Even if the platform maintains shared files between programs, a clean removal is ensured.

Requirements

Before you can bundle MSIX packages, you will need the following setup:

Steps on How to Bundle MSIX Packages

The following section presents a step-by-step approach to build an .msixbundle package. Before you proceed with this steps, make sure that you have converted your existing x86 and x64 versions of the Windows installer to MSIX packages.

Step 1: Find MakeAppx.exe

The Windows 10 SDK includes a program called MakeAppx.exe that enables the packaging and bundling of MSIX packages. This program will be used to combine the two MSIX packages.

A Windows 10 app package or bundle’s file contents can be extracted using MakeAppx.exe. Additionally, it encrypts and decrypts app bundles and packages. Depending on the Windows 10 SDK version installed, the MakeAppx.exe program can found in this location:

  • [x86] – C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\MakeAppx.exe
  • [x64] – C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\MakeAppx.exe
App packager (MakeAppx.exe) 
App packager (MakeAppx.exe) 

Step 2: Bundle the packages

Once you have your SDK installed and you have the converted x64 and x86 MSIX packages, the next step is to bundle the packages.

First, move the app packages you wish to bundle into a single directory/folder, as shown below.

The AppID, publisher, and version must all be the same since MakeAppx.exe only bundles together packages that have the same identity. Only the processor architecture of the application package might be different.

Press Windows key to open the Start menu, search for command prompt and run as administrator.

Bundle MSIX packages: Run the command prompt as administrator
Run the command prompt as administrator

Enter the following command to bundle the packages using the MakeAppx.exe.

C:\> "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86\MakeAppx.exe" bundle /d <input_directorypath> /p <filepath>.msixbundle

In the command above, replace the <input_directorypath> with the directory/folder path of the packages, and the <filepath> with the package file path.

Here is an example code from Microsoft

C:\> "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\MakeAppx.exe" bundle /d c:\AppPackages\ /p c:\MyLOBApp_10.0.0.0_ph32m9x8skttmg.msixbundle
Bundling MSIX Packages
Bundling MSIX Packages

After running the command, an unsigned .msixbundle will be created in the path specified. Packages do not need to be signed before bundling.

Step 3: Sign the bundle

After you’ve bundle the packages, you will need to sign it before you can distribute or install it for users. The SignTool.exe included in the Windows 10 SDK package can be used for a generic code signing certificate. The SignTool.exe is located in the same directory as MakeAppx.exe.

Signtool.exe file
Signtool.exe file

It is highly advise that you use a trusted certificate from a certificate authority so that the package can be delivered and installed on your end users’ devices easily. Sign the package using the private certificate (.pfx file) as described below.

Press Windows key to open the Start menu, search for command prompt and run as administrator.

Run the command prompt as administrator
Run the command prompt as administrator

Enter the following command to bundle the packages using the MakeAppx.exe.

C:\> "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\SignTool.exe" sign /fd <Hash Algorithm> /a /f <Path to Certificate>.pfx /p <Your Password> <File path>.msixbundle

Here is an example code from Microsoft

C:\> "C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x86\SignTool.exe" sign /fd SHA256 /a 
/f c:\private-cert.pfx /p aaabbb123 c:\MyLOBApp_10.0.0.0_ph32m9x8skttmg.msixbundle
Signing an .msixbundle file
Signing an .msixbundle file

After successfully signing the bundle, you can now go ahead to distribute or install it for your users.

I hope you find the post helpful. If you have any questions, please leave a comment below.

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x