| page_type | sample | |||||
|---|---|---|---|---|---|---|
| languages |
|
|||||
| products |
|
|||||
| name | Multi-headed MSIX package sample | |||||
| urlFragment | multi-headed-package | |||||
| description | Shows how to package multiple executables in a single MSIX or sparse package | |||||
| extendedZipContent |
|
These samples demonstrate how to create multi-headed packages — whether MSIX or sparse-packaged — by defining multiple <Application> elements in a single Package.appxmanifest. Each application entry gets its own Start menu tile and can be launched independently, while sharing the same package identity and installation lifecycle.
A WinUI 3 solution using single-project MSIX packaging with two projects:
- PrimaryApp — The main WinUI app that owns the package manifest. Uses
$targetnametoken$tokens so the build system fills in the correct executable name. - SecondaryApp — A console app included in the same MSIX package. Its executable name is hardcoded in the manifest as
SecondaryApp.exewithEntryPoint="Windows.FullTrustApplication".
After deployment, both apps appear in the Start menu as separate entries.
A WPF solution demonstrating multi-headed sparse packages with runtime registration:
- PrimaryApp — A WPF app with
WindowsPackageType=Sparsethat registers the sparse package at runtime using thePackageManagerAPI. After registration, it usesIApplicationActivationManagerto relaunch with package identity via the app's AUMID (Application User Model ID). - SecondaryApp — A minimal WPF app that detects whether it has package identity. Once the sparse package is registered, the primary app can launch this secondary app with identity using the
SecondaryAppAUMID entry point.
Key implementation details:
- The manifest uses
uap10:AllowExternalContent="true"to enable sparse packaging. - Application entries use
uap10:RuntimeBehavior="win32App"instead ofEntryPoint(these are mutually exclusive). - Restart/launch uses
IApplicationActivationManager.ActivateApplication()with the package AUMID to ensure the process receives package identity. Launching the exe directly withProcess.Startwould bypass the package activation and the process would not have identity. - A test certificate (
PrimaryApp_TemporaryKey.pfx) is included because sparse packages must be signed to be registered.
- See System requirements for Windows app development.
- Make sure that your development environment is set up correctly—see Install tools for developing apps for Windows 10 and Windows 11.
- Open
cs/cs-winui-msix/MultiHeadedMsix.slnin Visual Studio. - Set PrimaryApp as the startup project.
- Press F5 to build, deploy, and launch the primary app.
- Check the Start menu for both "Primary App" and "Secondary App" entries.
- Open
cs/cs-wpf-sparse/MultiHeadedSparse.slnin Visual Studio. - Set PrimaryApp as the startup project.
- Trust the test certificate: run
certutil -addstore TrustedPeople cs\cs-wpf-sparse\PrimaryApp\PrimaryApp_TemporaryKey.pfxfrom an elevated terminal. - Press Ctrl+F5 to build and run without debugging.
- Click Register Package to register the sparse package with the OS.
- Click Restart to relaunch the app with package identity (the status should now show the package full name).
- Click Launch Secondary App to launch the secondary app entry point with package identity.
To clean up, click Unregister Package and restart.