Install Dependencies and Runtimes using MSIX Custom Install Declaration
The following article uses options that are available starting with the Enterprise edition and project type.
1. Example Use Case
Imagine you have an application that requires a specific database setup during installation. With MSIX's Custom Install declaration:
- You include a script or executable in the MSIX package.
- Create the custom install declaration pointing to the executable.
- When the MSIX package is installed, the system invokes the script or executable which initializes the database or install the runtime as part of the installation process.
This approach simplifies application deployment while maintaining the benefits of MSIX packaging, such as security and reliability.
2. Create your application's MSIX package
In this step you will create a new Advanced Installer Project for your application configured to build an MSIX. Just launch Advanced Installer and choose the MSIX package template to create a new project.
For a complete guide on how to create and configure an MSIX package using Advanced Installer please take a look on our dedicated article : Create an MSIX package
After you've finished the configuration, save .AIP project and build the MSIX.
3. Add the runtime package as part of the MSIX files
In the File and Folders view you can add the runtime or prerequisites that should be installed during the MSIX installation.
4. Define the Custom Install Declaration
In the Declaration view you can define the custom install for the package declaration.
For runtimes and prerequisies we recommend adding the switch for Basic
UI installation, to avoid displaying the runtime UI during the MSIX
installation. For packages that do not require admin privileges, you can pass the silent
switches.
Optional, you can configure the Uninstall action so that during the MSIX uninstall, the runtime will be uninstalled as well.
5. Conclusion
The Custom Install Package Declaration offers native support in MSIX to install runtimes and dependencies required by your application, or any other executable to prepare your application e.g. configure a database.
When installing runtimes or dependencies, they are not installed in a container,
they are installed directly on the machine as a traditional MSI installer.
The MSIX will list accordingly the Custom Install Package Declaration:
6. Notes
During internal testing, we observed varying behavior of the same MSIX package across different Windows versions. These differences may affect the installation process, so it’s important to consider the following findings:
- Windows 11 (Version 21H2 build 22000.194): Developer Mode was not required for the MSIX package installation to succeed.
- Windows 11 (Version 23H2): Developer Mode was not required for the MSIX package installation to succeed.
- Windows 11 (Version 24H2): Developer Mode became mandatory for the MSIX package installation process.
The restricted capabilities is exclusively supported on
Windows 11.
You can target the MSIX package supported platform in the MSIX Configuration Tab.
According to Microsoft documentation, this element is currently intended to be used only
by certain types of desktop PC games that are published by Microsoft and our partners. It
requires the customInstallActionsrestricted capabilities.