How to Change the Packaging Type of APPX or MSIX - UWP vs. Win32 App

Written by Alex Marin · March 8th, 2023

In some cases, changing the packaging type of an application requires going back to the drawing board. Even though Advanced Installer's GUI lets you convert MSIX packages by importing them, changing the packaging type of an application can still be a bit tricky.

In this article, we’ll see what the limitations of APPX are when changing packaging types, and understand the context of APPX packages.

What are the limitations of APPX packages when changing packaging type?

We have two main limitations when it comes to changing the packaging type of an APPX/MSIX to an MSI:

1. APPX packages were designed for UWP applications, which were purely intended to run in containers. This characteristic makes the conversion to MSI nearly impossible.

2. APPX/MSIX also sometimes contain a Win32 app (a Centennial app), for which we also have multiple scenarios.

Let's see how to sort through them and carry out the packaging type conversion.

1. The packaged application is pure UWP application (pure APPX)

In this case, the APPX/MSIX cannot be converted to an MSI, as the application can only run from its container. The only approach that can be used here is MSI wrapping.

Although MSI wrapping implies that the original APPX package is installed, certain operations can be performed with the MSI both before and after the APPX package is deployed.

NoteMake sure the MSI is not running with administrative privileges when using the MSI wrapping method because the APPX package will be installed under the Admin account and not the LogonUser account. Also, if the deployment is carried out using the LocalSystem account, there can be some issues (e.g. Microsoft Intune deployment, SCCM).

Let’s see how you can perform MSI wrapping when your application is pure UWP (pure APPX):

1. To set a package to be installed per-user only, navigate to the Install Parameters page and choose the Installation Type to be Per-user only.

Choose Per-user only Installation Type

2. As you can see, once you select per-user only, the application folder default is set to AppDataFolder which is per-user location.

3. Once we have the package defined to be installed on a per-user basis, we need to add the APPX package in the package via the Files and Folders page.

4. Next, we need to install it by using custom actions.

NoteAdvanced Installers offers predefined custom actions for APPX/MSIX manipulation:
Install APPX/MSIX

Uninstall APPX/MSI

Install MSIX using Custom Actions

If APPX/MSIX is signed with a self-signed certificate, you can use the predefined install certificate custom action so that the signature is trusted on the machine.

ImportantThe install certificate custom action is intended to ask for admin rights. If the user doesn’t have administrator privileges and the operation requires elevation as a different user, the install MSIX/APPX custom action will not install the package on the currently logged-in user.

2. The packaged application is Win32 app

Unlike the UWP applications, when your APPX/MSIX package contains a Win32 app you can encounter one of the following scenarios:

1. The packaged Win32 app usemodern APIs

2. The packaged Win32 app does not uses modern APIs

It is important to know which scenario you are in since it determines whether you will use the above-described wrapping method or repackage the Win32 app as a traditional MSI package.

If the packaged Win32 app requires access from the AppxManifest in order to use modern APIs or it must have an identity, then the only option would be to perform MSI wrapping.

However, if your Win32 app is a classical one, you can use the “MSIX Package” wizard to import the package in Advanced Installer.

Here’s how it’s done:

1. Open Advanced Installer, navigate to the Import tab, and select MSIX Package.

Import MSIX Package

2. After you finish configuring the import settings, you will notice that an MSI project type gets generated.

Generated MSI

This gives you the possibility of creating an MSI build. You have full flexibility in Advanced Installer.

Conclusion

In conclusion, changing the packaging type of an application can be challenging, especially when dealing with APPX/MSIX packages.

When converting APPX/MSIX packages to MSI, MSI wrapping is often the only option for pure UWP applications, while for APPX/MSIX packages containing Win32 apps, the approach depends on whether the Win32 app uses modern APIs or not.

Advanced Installer offers solutions for both scenarios, including predefined custom actions for APPX/MSIX manipulation and an "MSIX package" wizard to import and generate an MSI project type.

If you have any ideas for articles you'd like to see in the future, feel free to drop them in the comments below!

Written by
See author's page
Alex Marin

Application Packaging and SCCM Deployments specialist, solutions finder, Technical Writer at Advanced Installer.

Comments: