Handle Prerequisites by Declaring Dependencies in MSIX

Written by Alex Marin · March 14th, 2025 · 6min read

Application dependencies are a common requirement in the packaging industry. With the transition from MSI to MSIX, we now have more options to declare and handle them.

In MSI, we use Prerequisites to chain multiple dependencies, meaning that the installation proceeds only if the product is found in the chain; otherwise, it fails.

NoteFor more details about Prerequisites, check out our FAQ.

Microsoft has enhanced dependency management in MSIX, providing more flexible alternatives for packagers.

In this article, we will explore:

  • What is an MSIX dependency
  • How MSIX dependencies work
  • Handling Non-MSIX Dependencies in Advanced Installer
  • Defining MSIX Dependencies in Advanced Installer

TipYou can try Advanced Installer for free through our 30-day full featured trial.Download it from here.

What is a Package Dependency and How Can It Be Added to the MSIX Manifest?

A PackageDependency helps define package dependencies and incompatibilities that may slow down your application's installation process.

You can find the <Dependencies> element in every AppxManifest.xml file within an MSIX package.

The <Dependencies> element usually contains the minimum required OS version and the maximum tested OS version needed for your application to install.

NoteYour installation will fail if the minimum OS version declared in the MSIX manifest is higher than the OS version of your machine.

Here’s an example of how an OS version dependency looks like in our AppManifest:

<Dependencies>
	<TargetDeviceFamily MaxVersionTested="10.0.19041.0" MinVersion="10.0.17763.0" Name="Windows.Desktop"/>
  </Dependencies>

If your MSIX package requires a specific prerequisite (dependency) to install, you can add it in the <Dependencies> element as a PackageDependency child element.

ImportantPackage Dependency only supports MSIX dependencies. It doesn’t support other formats such as MSI or EXE.

Handling Non-MSIX Dependencies with Custom Install Declarations in Advanced Installer

Advanced Installer also allows you to include a script or executable within the MSIX package and create a custom install declaration pointing to the executable.

This ensures that when the MSIX package is installed, the system invokes the script or executable, initializing the database or installing the runtime as part of the installation process.

Behavior may vary across different Windows versions, so be sure to check for any specific requirements.

For a detailed guide on adding MSI or EXE dependencies inside an MSIX package, check out our user guide on Defining Custom Dependencies using Advanced Installer’s MSIX Custom Install Declaration.

This feature is available starting with the Enterprise edition, and you can try Advanced Installer for free through its 30-day full featured trial.

Can you make a Dependency Package optional?

Microsoft provides the option to make a dependency optional. When enabled, you can install the main MSIX package even if the dependency is not found.

By default, this flag is set to “false”.

So, if you add a dependency like the one in the example below, the installation will fail since the application (in our case Caphyon.SampleApplication) must be installed on the machine.

<Dependencies>
	<TargetDeviceFamily MaxVersionTested="10.0.19041.0" MinVersion="10.0.17763.0" Name="Windows.Desktop"/>
	<PackageDependency MinVersion="2.0.0.0" Name="Caphyon.SampleApplication" Publisher="CN=TestCert_2020-3-25_14-56-53"/>
  </Dependencies>

To make a dependency optional, we can use the uap6:Optional attribute and set it to true:

<Dependencies>
	<TargetDeviceFamily MaxVersionTested="10.0.19041.0" MinVersion="10.0.17763.0" Name="Windows.Desktop"/>
	<PackageDependency MinVersion="2.0.0.0" Name="Caphyon.SampleApplication" uap6:Optional="true" Publisher="CN=TestCert_2020-3-25_14-56-53"/>
  </Dependencies>

How does an MSIX dependency work, and how can they be installed

Now that we understand what dependencies are and how they are added to the MSIX manifest, let's see how they work and how they differ from MSI dependencies.

First, let's recap how MSIX packages can be installed:

  1. Via the Microsoft Store.
  2. Via a website: MSIX package.
  3. Via a website: .appinstaller file.

Let’s have a look at the scenarios to see how dependencies behave in each case.

1. Installing MSIX Dependencies via Microsoft Store

When you publish your package to the Microsoft Store, you must also publish its dependencies. This way, when a user installs your application using the Microsoft Store, dependencies are also automatically downloaded and installed.

NoteThe automatic download and installation of a dependency also happens if the dependency has already been published before in the Microsoft Store.

If your dependency is a third-party application (packaged as an MSIX), you have two options:

  • Ask the vendor to publish the dependency on the Microsoft Store
  • Add it as an optional dependency in your MSIX manifest and then ask users to manually install it from the third-party vendor website.

2. Installing MSIX Dependencies via a website (MSIX package)

Microsoft offers the MS-AppInstaller protocol which can be easily added to any website.

However, if you add a dependency to your MSIX package and publish it to your website, you will be prompted with an error message.

This happens because the package does not know where the dependency is located as seen below:

Demo Installation Fail message in Advanced Installer

To fix this issue:

  • Mark the dependency as optional in your MSIX package
  • Instruct users on your website to first install the dependency and then the main package.

Alternatively, you can use .appinstaller files as described below.

3. Installing MSIX Dependencies via .appinstaller files

In our article How to enable auto-updates for your MSIX packages without publishing them to the Microsoft Store, we explain that creating an .appinstaller file is required, and that the MSIX package must be installed via that appinstaller file.

NoteYou can create .appinstaller files with one click using Advanced Installer.Learn more in our how-to guide: How to create an AppInstaller file for an MSIX package.

Once an .appinstaller file is created, you can add the Dependencies element to it and specify the location of the dependency:

<Dependencies>    <Package Name="Microsoft.VCLibs.140.00" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="14.0.24605.0" ProcessorArchitecture="x86" Uri="http://foobarbaz.com/fwkx86.appx" />    <Package Name="Microsoft.VCLibs.140.00" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="14.0.24605.0" ProcessorArchitecture="x64" Uri="http://foobarbaz.com/fwkx64.appx" />  </Dependencies>When you add the <Dependencies> element to the .appinstaller file, the dependencies will be installed first from the specified location, followed by the main application. 

Defining MSIX Dependencies with Advanced Installer

The scenarios we've gone through may seem a little bit tricky when it comes to declaring dependencies inside an MSIX package. Luckily, Advanced Installer’s GUI makes this step effortless.

To add a simple MSIX dependency, simply follow these steps:

  1. Create a new MSIX package, or open your existing project.
  2. Navigate to the Dependencies Page.
  3. Click on Add Dependency in the upper right corner.
  4. Select your MSIX package.
Package Dependencies in Advanced Installer

That’s it! The dependency is now added.

You can leave the optional to false (to make the dependency required) or you can change it to true.

TipIf you also need to create the .appinstaller file, Advanced Installer automatically detects dependencies and includes them in the .appinstaller file when you build the package—no extra configurations required.
Check the step-by-step guide here.

Conclusion

We hope this guide has given you a clear overview of how dependencies work in MSIX and how to handle them using different methods—including Advanced Installer’s GUI.

What’s your preferred method for managing dependencies? Let us know.

Written by
See author's page
Alex Marin

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

Comments: