### Example App Installer File Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/app-installer/how-to-create-appinstaller-file.md This XML file defines a related set of packages, including a main bundle and optional packages, along with update and repair URIs and update settings. ```xml http://mywebservice.azurewebsites.net/appset.appinstaller http://mywebservice2.azurewebsites.net/appset.appinstaller http://mywebservice.azurewebsites.net/appset.appinstaller http://mywebservice2.azurewebsites.net/appset.appinstaller ``` -------------------------------- ### Key file example Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/create-app-package-with-makeappx-tool.md This is an example of a key file format used for encrypting or decrypting packages. It must start with '[Keys]' followed by base64 encoded key ID and encryption key pairs. ```Example [Keys] "OWVwSzliRGY1VWt1ODk4N1Q4R2Vqc04zMzIzNnlUREU=" "MjNFTlFhZGRGZEY2YnVxMTBocjd6THdOdk9pZkpvelc=" ``` -------------------------------- ### Start MSIX Tracing Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/msix-core/msixcore-troubleshoot.md Use this command to start the MSIX tracing script and begin capturing installation logs. The script will prompt for further actions. ```PowerShell msixtrace.ps1 -start ``` -------------------------------- ### Handle protocol activation with installation parameters in C# Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/app-installer/install-parameters.md Implement code to handle installation parameters passed to your app during protocol activation. This example uses AppInstance.GetActivatedEventArgs to determine the activation type and extracts parameters from the URI if it's a protocol activation. ```csharp using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; public static void Main(string[] cmdArgs) { var activationArgs = AppInstance.GetActivatedEventArgs(); switch (activationArgs.Kind) { //Install parameters will be passed in during a protocol activation case ActivationKind.Protocol: HandleProtocolActivation(activationArgs as ProtocolActivatedEventArgs); break; case ActivationKind.Launch: //Regular launch activation type HandleLaunch(activationArgs as LaunchActivatedEventArgs); break; default: break; } static void HandleProtocolActivation(ProtocolActivatedEventArgs args) { if (args.Uri != null) { //Handle the installation parameters in the protocol uri handleInstallParameter(args.Uri.ToString()); } } } ``` -------------------------------- ### MakeAppx pack command examples Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/create-app-package-with-makeappx-tool.md These examples illustrate practical usage of the MakeAppx pack command, including options for verbosity, hash algorithm, content directory, output package name, and encryption. ```examples MakeAppx pack /v /h SHA256 /d "C:\My Files" /p MyPackage.msix ``` ```examples MakeAppx pack /v /o /f MyMapping.txt /p MyPackage.msix ``` ```examples MakeAppx pack /m "MyApp\AppxManifest.xml" /f MyMapping.txt /p AppPackage.msix ``` ```examples MakeAppx pack /r /m "MyApp\AppxManifest.xml" /f MyMapping.txt /p ResourcePackage.msix ``` ```examples MakeAppx pack /v /h SHA256 /d "C:\My Files" /ep MyPackage.emsix /kf MyKeyFile.txt ``` ```examples MakeAppx pack /v /h SHA256 /d "C:\My Files" /ep MyPackage.emsix /kt ``` -------------------------------- ### Check for, download, and install app updates Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/store-developer-package-update.md Use this method to let the system handle checking for updates, downloading them, and then prompting the user for installation. The result of the user's choice (install now or defer) is returned. ```csharp using Windows.Services.Store; private async void GetEasyUpdates() { StoreContext updateManager = StoreContext.GetDefault(); IReadOnlyList updates = await updateManager.GetAppAndOptionalStorePackageUpdatesAsync(); if (updates.Count > 0) { IAsyncOperationWithProgress downloadOperation = updateManager.RequestDownloadAndInstallStorePackageUpdatesAsync(updates); StorePackageUpdateResult result = await downloadOperation.AsTask(); } } ``` -------------------------------- ### Install App Link with ms-appinstaller Protocol Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/desktop/azure-dev-ops.md An example of an HTML anchor tag that uses the ms-appinstaller protocol. Clicking this link allows users to directly install the app from a web server without downloading the MSIX package first, provided the server is configured correctly and supports byte-range requests. ```html Install App ``` -------------------------------- ### Examples for unpacking and unbundling Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/create-app-package-with-makeappx-tool.md These examples demonstrate how to unpack and unbundle MSIX packages and bundles, including encrypted ones using key files or the global test key. ```examples MakeAppx unpack /v /p MyPackage.msix /d "C:\My Files" ``` ```examples MakeAppx unpack /v /ep MyPackage.emsix /d "C:\My Files" /kf MyKeyFile.txt ``` ```examples MakeAppx unpack /v /ep MyPackage.emsix /d "C:\My Files" /kt ``` ```examples MakeAppx unbundle /v /p MyBundle.msixbundle /d "C:\My Files" ``` ```examples MakeAppx unbundle /v /ep MyBundle.emsixbundle /d "C:\My Files" /kf MyKeyFile.txt ``` ```examples MakeAppx unbundle /v /ep MyBundle.emsixbundle /d "C:\My Files" /kt ``` -------------------------------- ### MakeAppx bundle command examples Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/create-app-package-with-makeappx-tool.md These examples demonstrate practical usage of the MakeAppx bundle command for creating app bundles, including options for verbosity, content directory, output bundle name, bundle version, and encryption. ```examples MakeAppx bundle /v /d "C:\My Files" /p MyBundle.msixbundle ``` ```examples MakeAppx bundle /v /o /bv 1.0.1.2096 /f MyMapping.txt /p MyBundle.msixbundle ``` ```examples MakeAppx bundle /v /o /bv 1.0.1.2096 /f MyMapping.txt /ep MyBundle.emsixbundle /kf MyKeyFile.txt ``` ```examples MakeAppx bundle /v /o /bv 1.0.1.2096 /f MyMapping.txt /ep MyBundle.emsixbundle /kt ``` -------------------------------- ### Examples for encrypting and decrypting Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/create-app-package-with-makeappx-tool.md These examples demonstrate how to encrypt and decrypt MSIX packages using either a key file or the global test key. ```examples MakeAppx.exe encrypt /p MyPackage.msix /ep MyEncryptedPackage.emsix /kt ``` ```examples MakeAppx.exe encrypt /p MyPackage.msix /ep MyEncryptedPackage.emsix /kf MyKeyFile.txt ``` ```examples MakeAppx.exe decrypt /p MyPackage.msix /ep MyEncryptedPackage.emsix /kt ``` ```examples MakeAppx.exe decrypt p MyPackage.msix /ep MyEncryptedPackage.emsix /kf MyKeyFile.txt ``` -------------------------------- ### Completed config.json Example Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/psf/psf-launch-apps-with-parameters.md This is a fully configured `config.json` example, demonstrating how to map the `Id`, `Executable`, and `arguments` from the `AppxManifest.xml` and recorded launch parameters. ```json { "applications": [ { "id": "PSFSample", "executable": "VFS/ProgramFilesX64/PS Sample App/PSFSample.exe", "arguments": "/bootfromsettingshortcut" } ] } ``` -------------------------------- ### Install AzureSignTool .NET Global Tool Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/desktop/cicd-keyvault.md Install the AzureSignTool as a .NET global tool. Ensure you have the latest .NET SDK installed. ```bash dotnet tool install --global AzureSignTool ``` -------------------------------- ### Configure App Installer with Update URIs Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/app-installer/how-to-create-appinstaller-file.md This example demonstrates how to specify fallback update URIs in your App Installer file. These URIs are used if the primary App Installer URI becomes inaccessible. A maximum of 10 URIs can be configured. This requires schema version 2021 or newer. ```xml https://www.contoso.com/Installers/MainApp.AppInstaller \\ServerName\Share\Installers\MainApp.AppInstaller ``` -------------------------------- ### Install MSIX Packaging Tool with WinGet Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/packaging-tool/tool-overview.md Use the WinGet command-line tool to install the MSIX Packaging Tool. ```powershell PS C:\> winget install "MSIX Packaging Tool" ``` -------------------------------- ### Example config.json with Values Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/psf/package-support-framework-vs.md This example shows a populated config.json file with sample values for applications, processes, and fixups. Ensure your values align with your project's structure and needs. ```json { "applications": [ { "id": "DesktopApplication", "executable": "DesktopApplication/WinFormsDesktopApplication.exe", "workingDirectory": "WinFormsDesktopApplication" } ], "processes": [ { "executable": ".*App.*", "fixups": [ { "dll": "RuntimeFix.dll" } ] } ] } ``` -------------------------------- ### Create HTML link for App Installer Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/app-installer/web-install-azure.md Use this HTML code to create a link that invokes the App Installer protocol for installing an MSIX bundle. Ensure the `source` URL points to your app package hosted on Azure. ```html Install My Sample App Install My Sample App ``` -------------------------------- ### HTML for App Installation Links Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/app-installer/installing-windows10-apps-web.md Use this HTML structure to create links that launch the App Installer for your app packages. Ensure your URIs are prefixed with 'ms-appinstaller:?source='. ```html

MyApp Web Page

Install app package Install app bundle Install related set ``` -------------------------------- ### Install Package Support Framework using NuGet Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/psf/psf-current-working-directory.md Installs the Microsoft.PackageSupportFramework using the NuGet CLI. Ensure you are running this from an Administrative PowerShell window. ```PowerShell Set-Location "C:\PSF" . uget\nuget.exe install Microsoft.PackageSupportFramework ``` -------------------------------- ### Install MSIX with Dependencies Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/desktop/managing-your-msix-deployment-troubleshooting.md Use this command to install an MSIX package along with its dependency packages. Ensure all dependency files are available. ```powershell Add-AppxPackage main.msix -DependencyPath dep1.msix, dep2.msix ``` -------------------------------- ### Install Package Support Framework via NuGet CLI Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/psf/package-support-framework.md Install the Microsoft.PackageSupport.Framework NuGet package using the command line tool. This provides the necessary PSF files for your project. ```powershell nuget install Microsoft.PackageSupportFramework ``` -------------------------------- ### Install the MSIX package with PowerShell Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/psf/package-support-framework.md Installs the signed MSIX package onto the system. Ensure the package is uninstalled first if it already exists. ```powershell powershell Add-AppPackage .\PSFSamplePackageFixup.msix ``` -------------------------------- ### Install Windows SDK in GitHub Actions Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/msix-troubleshooting-guide.md Installs the Windows SDK using winget in a GitHub Actions CI/CD pipeline to resolve 'signtool' not found errors. ```yaml - name: Install Windows SDK run: | winget install --id Microsoft.WindowsSDK.10.0.22621 --accept-source-agreements --accept-package-agreements ``` -------------------------------- ### Install downloaded app updates Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/store-developer-package-update.md This code snippet demonstrates how to initiate the installation of previously downloaded updates. It's important to save the app's state before calling this, as the app may terminate after the update is applied. ```csharp private async void InstallUpdatesAsync() { StoreContext updateManager = StoreContext.GetDefault(); IReadOnlyList updates = await updateManager.GetAppAndOptionalStorePackageUpdatesAsync(); // Save app state here IAsyncOperationWithProgress installOperation = updateManager.RequestDownloadAndInstallStorePackageUpdatesAsync(updates); StorePackageUpdateResult result = await installOperation.AsTask(); // Under normal circumstances, app will terminate here // Handle error cases here using StorePackageUpdateResult from above } ``` -------------------------------- ### SignTool Internal Error Example Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/signing-known-issues.md This is an example of an unexpected internal error that can occur when using SignTool. Error codes starting with 0x8008 indicate an invalid package. ```syntax SignTool Error: An unexpected internal error has occurred. Error information: "Error: SignerSign() failed." (-2147024885 / 0x8007000B) ``` -------------------------------- ### MakeAppx bundle command syntax options Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/create-app-package-with-makeappx-tool.md These examples show the basic syntax for the MakeAppx bundle command, demonstrating how to create app bundles using content directories or mapping files, with options for encryption. ```syntax MakeAppx bundle [options] /d /p ``` ```syntax MakeAppx bundle [options] /f /p ``` ```syntax MakeAppx bundle [options] /d /ep /kf MyKeyFile.txt ``` ```syntax MakeAppx bundle [options] /f /ep /kt ``` -------------------------------- ### Get MSIX Deployment Logs with PowerShell Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/desktop/managing-your-msix-deployment-troubleshooting.md Use this PowerShell command to retrieve the last 20 MSIX deployment events, filtering for a specific event ID. This helps in diagnosing installation failures. ```powershell Get-AppxLog | Where-Object {$_.EventId -eq 404} | Select-Object -Last 20 ``` -------------------------------- ### MakeAppx pack command syntax options Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/create-app-package-with-makeappx-tool.md These examples demonstrate the basic syntax for the MakeAppx pack command, showing how to specify content directories or mapping files for creating app packages. ```syntax MakeAppx pack [options] /d /p ``` ```syntax MakeAppx pack [options] /f /p ``` ```syntax MakeAppx pack [options] /m /f /p ``` ```syntax MakeAppx pack [options] /r /m /f /p ``` ```syntax MakeAppx pack [options] /d /ep /kf ``` ```syntax MakeAppx pack [options] /d /ep /kt ``` -------------------------------- ### Install MSIX Package Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/msix-core/deploy-with-msix-core.md Install an MSIX package using msixmgr.exe. The -quietUX parameter suppresses the installer UI for a silent installation. ```PowerShell msixmgr.exe -AddPackage C:\NotePadPlus\notepadplus.msix -quietUX ``` -------------------------------- ### Check App Installer Version with PowerShell Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/app-installer/install-update-app-installer.md Use this PowerShell command to determine the version of App Installer that is currently installed on your system. ```powershell (Get-AppxPackage Microsoft.DesktopAppInstaller).Version ``` -------------------------------- ### Sample PSF Configuration with Multiple Applications Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/psf/run-scripts-with-package-support-framework.md This JSON configuration defines two applications, 'Sample' and 'CPPSample', each with specific start and end scripts. It illustrates how to set script paths, arguments, and execution options like running in a virtual environment or showing a window. ```json { "applications": [ { "id": "Sample", "executable": "Sample.exe", "workingDirectory": "", "stopOnScriptError": false, "startScript": { "scriptPath": "RunMePlease.ps1", "scriptArguments": "\"First argument\" secondArgument", "runInVirtualEnvironment": true, "showWindow": true, "waitForScriptToFinish": false }, "endScript": { "scriptPath": "RunMeAfter.ps1", "scriptArguments": "ThisIsMe.txt" } }, { "id": "CPPSample", "executable": "CPPSample.exe", "workingDirectory": "", "startScript": { "scriptPath": "CPPStart.ps1", "scriptArguments": "ThisIsMe.txt", "runInVirtualEnvironment": true }, "endScript": { "scriptPath": "CPPEnd.ps1", "scriptArguments": "ThisIsMe.txt", "runOnce": false } } ], "processes": [ ...(taken out for brevity) ] } ``` -------------------------------- ### Install WinApp CLI Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/sign-msix-package-guide.md Installs the Windows App Development CLI using winget. This tool is recommended for new projects and requires Windows 10 with WinGet installed. ```powershell winget install -e --id Microsoft.WinAppCLI --source winget ``` -------------------------------- ### Remove Loopback Exemption for App Installer Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/app-installer/web-install-IIS.md Execute this command to remove the App Installer from the loopback exempt list after you have completed local validation of app installation. ```Command Line CheckNetIsolation.exe LoopbackExempt -d -n=microsoft.desktopappinstaller_8wekyb3d8bbwe ``` -------------------------------- ### Minimal ConversionTemplate.xml for MSI Installer Source: https://context7.com/microsoftdocs/msix-docs/llms.txt A basic XML template for the MSIX Packaging Tool to convert an MSI installer. It configures settings, preparation steps, save location, installer details, and package information. ```xml ``` -------------------------------- ### Create ClickOnce Setup.exe with MSIX URL Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/msix-core/msixcore-clickonce-solution.md Generate a ClickOnce setup.exe that points to the location of your MSIX package in a web service. ```PowerShell .\setup.exe -url= ``` ```PowerShell .\setup.exe -url="https://appinstallerdemo.azurewebsites.net/MSIXCore/msixmgrWrapper.application?https://appinstallerdemo.azurewebsites.net/MSIXCore/notepadplus.msix#" ``` -------------------------------- ### Configure MSIX Dependencies in App Installer Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/msix-troubleshooting-guide.md For distribution outside the Microsoft Store, include framework dependencies within your .appinstaller file. This allows the App Installer to automatically download and install necessary runtime packages for your application. ```xml ``` -------------------------------- ### Basic File Mapping Example Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/create-app-package-with-makeappx-tool.md Use this format for a simple mapping file that lists files to be included in the package. Each line specifies the source path and the destination path within the package. ```plaintext [Files] "C:\MyApp\StartPage.html" "default.html" "C:\Program Files (x86)\example.txt" "misc\example.txt" "\MyServer\path\icon.png" "icon.png" "my app files\readme.txt" "my app files\readme.txt" "CustomManifest.xml" "AppxManifest.xml" ``` -------------------------------- ### Install MSIX Packages with PowerShell Source: https://context7.com/microsoftdocs/msix-docs/llms.txt Use Add-AppxPackage to install signed MSIX packages, register loose manifests for testing, or install with optional external packages. Ensure the correct path to the .msix file or manifest is provided. ```powershell # --- Install a signed MSIX package --- Add-AppxPackage -Path "C:\Packages\MyApp.msix" ``` ```powershell # --- Install from a loose manifest (for testing before packaging) --- Add-AppxPackage -Register "C:\MyAppFiles\AppxManifest.xml" ``` ```powershell # --- Install with external packages (optional packages, related sets) --- Add-AppxPackage -Path ".\MyApp.msix" -ExternalPackages ".\MyOptional.msix" ``` -------------------------------- ### Create Flat Bundle with MakeAppx.exe Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/flat-bundles.md Use the MakeAppx.exe bundle command with the /fb switch to generate a small flat app bundle file that only references app package files. ```syntax MakeAppx bundle [options] /d /fb /p ``` -------------------------------- ### PSF config.json - Example Configuration Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/psf/package-support-framework.md An example of a completed config.json file for the Package Support Framework. It specifies the application ID, executable path, working directory, and details for a process fixup. ```json { "applications": [ { "id": "DesktopApplication", "executable": "DesktopApplication/WinFormsDesktopApplication.exe", "workingDirectory": "WinFormsDesktopApplication" } ], "processes": [ { "executable": ".*App.*", "fixups": [ { "dll": "RuntimeFix.dll" } ] } ] } ``` -------------------------------- ### HTML for App Installer Link Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/app-installer/web-install-IIS.md Include this HTML code in your web page to provide a link that invokes the App Installer for installing a Windows 10 app. Ensure the URL path matches your project's URL. ```HTML Install Page Install My Sample App ``` -------------------------------- ### Simple packaging layout example Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/package/packaging-layout.md This XML defines a packaging layout for an app bundle. It includes an x64 architecture package and a 'Media' asset package. Use this to specify app bundle structure, including primary and optional packages, and their files. ```xml ``` -------------------------------- ### MSIX Resources Element Example Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/desktop/desktop-to-uwp-manual-conversion.md Example of the Resources element for an MSIX package, specifying the language for the package resources. ```XML ``` -------------------------------- ### Install MSIX Dependency Packages Locally Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/msix-troubleshooting-guide.md When installing an MSIX package locally using Add-AppxPackage, use the -DependencyPackages parameter or install framework packages like VCLibs first. This ensures all required runtime components are present before your application attempts to launch. ```powershell # Install VCLibs dependency first Add-AppxPackage -Path .\Microsoft.VCLibs.x64.14.00.Desktop.appx # Then install your app Add-AppxPackage -Path .\MyApp.msix ``` -------------------------------- ### Check for App Installer Updates and Launch Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/non-store-developer-updates.md This C# code checks for available updates for the current app using `Package.CheckUpdateAvailabilityAsync`. If an update is available or required, it initiates the installation using `PackageManager.AddPackageByAppInstallerFileAsync` with the `ForceApplicationShutdown` option. Otherwise, it closes the App Installer view. ```csharp using Windows.Management.Deployment; public async void CheckForAppInstallerUpdatesAndLaunchAsync(string targetPackageFullName, PackageVolume packageVolume) { // Get the current app's package for the current user. PackageManager pm = new PackageManager(); Package package = pm.FindPackageForUser(string.Empty, targetPackageFullName); PackageUpdateAvailabilityResult result = await package.CheckUpdateAvailabilityAsync(); switch (result.Availability) { case PackageUpdateAvailability.Available: case PackageUpdateAvailability.Required: //Queue up the update and close the current instance await pm.AddPackageByAppInstallerFileAsync( new Uri("https://trial3.azurewebsites.net/HRApp/HRApp.appinstaller"), AddPackageByAppInstallerOptions.ForceApplicationShutdown, packageVolume); break; case PackageUpdateAvailability.NoUpdates: // Close AppInstaller. await ConsolidateAppInstallerView(); break; case PackageUpdateAvailability.Unknown: default: // Log and ignore error. Logger.Log($ ``` -------------------------------- ### Example of Generate PRI File Command Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/desktop/desktop-to-uwp-manual-conversion.md An example of the `MakePri.exe new` command for generating a PRI file, specifying the physical path to your application's root folder and its configuration file. ```Command Line \makepri.exe new /pr c:\MYAPP /cf c:\MYAPP\priconfig.xml ``` -------------------------------- ### MSIX Core Installation Program Source: https://github.com/microsoftdocs/msix-docs/blob/main/msix-src/msix-core/deploy-msix-core-app-with-configmgr.md Use this command in the Installation program field for the MSIX Core application deployment type. ```batch "C:\Program Files\msixmgr\msixmgr.exe -AddPackage [Application.msix] -quietUX" ```