Introduction to Deployment
Deploying your Windows application built with the Windows App SDK is a critical step to making your application available to users. The Windows App SDK provides a unified set of APIs and tools for developing modern Windows applications. This document outlines the key concepts and methods for deploying applications that leverage the Windows App SDK.
Applications built with the Windows App SDK can be deployed using various packaging technologies, primarily MSIX. MSIX is the recommended modern packaging format for Windows applications, offering benefits like clean installations, easy updates, and robust security.
Key Deployment Concepts
- MSIX Packaging: The standard for modern Windows application deployment.
- Runtime Dependencies: The Windows App SDK itself needs to be available on the user's machine.
- Package Management: How users install, update, and uninstall your application.
- Identity: Unique identification of your application package.
Deploying with MSIX
MSIX is the most common and recommended deployment method for Windows App SDK applications. It simplifies the deployment process and enhances the user experience.
Steps for MSIX Deployment:
- Create an MSIX Package: This involves configuring your project to create an MSIX package. In Visual Studio, you can right-click your project and select "Publish" > "Create App Package". Ensure that your project settings correctly reference the Windows App SDK NuGet packages.
-
Configure Package Manifest:
The application's manifest file (
AppxManifest.xml
) defines critical information such as the package identity, entry points, capabilities, and dependencies. For Windows App SDK applications, you'll typically declare dependencies on the appropriate Windows App SDK runtime packages. - Include Runtime Dependencies: When you build an MSIX package for a Windows App SDK app, the build process should automatically handle the inclusion of the necessary Windows App SDK runtime components. This ensures your app runs correctly on target machines.
- Signing the Package: For distribution, your MSIX package must be signed with a code signing certificate. This verifies the publisher's identity and ensures the package hasn't been tampered with. You can use a trusted third-party certificate or a self-signed certificate for testing.
-
Distribution Methods:
- Microsoft Store: Submit your signed MSIX package to the Microsoft Store for wide distribution.
- Enterprise Distribution: Use sideloading, Group Policy, or Mobile Device Management (MDM) solutions to deploy within an organization.
- Direct Download: Provide a direct download link for your MSIX package from your website.
Example of Package Manifest Snippet (Conceptual):
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10/1"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10/1"
xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10/1"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
xmlns:winappsdk="http://schemas.microsoft.com/appx/manifest/windowsappsdk/v1"
IgnorableNamespaces="uap iot rescap winappsdk">
<Identity Name="YourPublisher.YourApp"
Publisher="YourPublisher"
Version="1.0.0.0"
ProcessorArchitecture="x64" />
<Properties>
<DisplayName>Your App Name</DisplayName>
<PublisherDisplayName>Your Publisher Name</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.19041.0" Archit else="neutral" />
<!-- Windows App SDK Runtime Dependency -->
<PackageDependency Name="Microsoft.WindowsAppRuntime.1.0" PublishingId="Microsoft.VCLibs.140.00.1900" MinVersion="1010.0.1.0" />
</Dependencies>
<Applications>
<Application Id="App"
Executable="YourApp.exe"
EntryPoint="YourApp.App">
<uap:VisualProperties>
<Binding PrimaryBrandColor="YourColor" />
</uap:VisualProperties>
</Application>
</Applications>
<Capabilities>
<rescap:Capability5 Name="windows.websvc"/>
<rescap:Capability5 Name="windows.personalinfosecurity"/>
</Capabilities>
</Package>
Windows App SDK Runtime Management
An application packaged with MSIX automatically declares its dependency on the Windows App SDK runtime. When the MSIX package is installed, the system ensures the required Windows App SDK runtime packages are present.
The Windows App SDK runtime is delivered through the Microsoft Store. This means users will automatically receive updates to the runtime, ensuring compatibility and security without manual intervention for the runtime itself.
MinVersion
specified in your package manifest for the Windows App SDK runtime dependency matches or is less than the version of the runtime you are targeting and testing with.
Runtime Versions
The Windows App SDK is versioned independently. When developing your application, you specify which version of the Windows App SDK you are targeting. This version is then reflected in your MSIX package's dependencies.
For the latest information on Windows App SDK versions and their corresponding runtime package identifiers, please refer to the official Windows App SDK versioning documentation.
Other Deployment Scenarios (Briefly)
While MSIX is the primary and recommended deployment method, other scenarios might exist for specific needs.
- Framework-Dependent Deployment: Applications can be deployed as framework-dependent packages, relying on a shared Windows App SDK runtime installed separately.
- Self-Contained Deployment: While less common for distribution due to size, you can theoretically bundle all dependencies, including the runtime, within your application package. This is typically reserved for specific development or testing setups.
For most modern application development, focus on mastering MSIX packaging for a seamless and robust deployment experience.