Windows

 How to Bundle MSIX Packages

Bundle MSIX Packages
Bundle MSIX Packages

Windows App Package (MSIX) is a packaging format and deployment technology for Windows apps. MSIX is meant to replace the older MSI and AppX formats. It can be installed and managed through the Microsoft Store for Business and Microsoft Intune. MSIX can be used to distribute the desktop and Universal Windows Platform (UWP) apps. It 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. In this guide, you will learn about the “Windows App Package, and how to Bundle MSIX packages”.

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.

MSIX Key features

Below are the key features of MSIX. I show you how to build a bundle after you’ve converted your x86 and x64 Windows installers using MSIX Packaging Tool.

  • 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 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 to Bundle MSIX Packages

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 these 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 you have installed. The MakeAppx.exe program can be 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 the SDK installed, and you have converted the 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.

Image source: Microsoft (App packages)
Image source: Microsoft (App packages)
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 the Windows key to open the Start menu, search for the 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 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 bundled the packages, you will need to sign them 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 advised that you use a trusted certificate from a certificate authority so that the package can be delivered and installed on your end-user devices easily. Sign the package using the private certificate (.pfx file) as described below.

Press the Windows key to open the Start menu, search for the 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 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. You have learned about Windows App Package: How to bundle MSIX packages.

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