2 minute read

Deployment with DISM

Other MSIX/AppX Cmdlets

Additional, less frequently used, PowerShell cmdlets are part of the AppX module. These include cmdlets for provisioned packages (also available using the DISM command described in the next section), and those for Volumes (the location for the MSIX/AppX packages on any given disk partition): ● Add-AppXProvisionedPackage ● Get-AppXProvisionedPackage ● Remove-AppXProvisionedPackage ● Set-AppXProvisionedDataFile ● Optimize-AppXProvisionedPackages ● Add-AppXVolume ● Get-AppxVolume ● Mount-AppXVolume ● Unmount-AppXVolume ● Remove-AppXVolume ● Set-AppXDefaultVolume

Advertisement

Deployment with DISM

When talking about package deployment, Microsoft uses the term “offline” simply to indicate that the installation activity is disconnected from the end-user. For those instances where you need to perform an offline installation, you may deploy MSIX applications with the use of DISM58, or alternatively you may use the Add-AppxProvisionedPackage PowerShell cmdlet. Both of these methods inject the packages into

58 https://docs.microsoft.com/en-us/windowshardware/manufacture/desktop/mount-and-modify-a-windows-image-usingdism

Windows images when they are mounted offline. The functionality of these two methods appear to be the same, and where we show examples in this section using one or the other method you should be able to use the other.

Pre-provisioning allows for the application package content, and licensing file if needed, to be added to the Windows image as part of a preparation phase of imaging prior to sealing off the image for distribution. Microsoft uses pre-provisioning themselves within the OS images provided to you for many of the “in-box” UWP and MSIX application packages, such as Calculator. When you pre-provision the application package in this way, the app is not yet fully installed, but all contents needed are present in the image. Installation will automatically complete when a user logs into the booted image after image deployment. In a multi-user operating system, this means that each user logging onto the OS will have their own installation completed. This portion of the per-user installation consists of fully integrating the application into the user profile, including important integrations such as to the Start Menu and file type associations.

Offline Installation

Application packages acquired from the Microsoft Store include licensing that must be applied. For offline installation to work, you need to acquire and add the licencing file when adding the package.

Currently, the Windows Store interface does not support separation of the license file, however organizations may use their Windows Store for Business, or Store for Education, to obtain the msix file or bundle and

license file. When requesting the license file, you should download the xml version of that file when using the method shown here.

The Add-AppxProvisionedPackage commandlet adds a package to the image that is installed per user when they log into the device. You can customize the MSIX package further by including additional packages, for example, a license file with the use of the LicensePath parameter.

Add-AppxProvisionedPackage -Path C:\offline -PackagePath C:\Packages\MyPackage\MyPackage.msix -LicensePath C:\Packages\MyPackage\MyLicense.xml

Each application will have unique dependencies that will need to be included in the offline package, some will be required, and some will be optional. In most use cases (where there is an Internet connection), dependencies are simply downloaded when needed, but in the case of offline installations, required dependencies must be specified so that they are present to complete the application install. Dependent packages are specified using the DependencyPackagePath parameter.

Add-AppxProvisionedPackage -Path c:\offline -PackagePath C:\Packages\MyPackage\MyPackage.msix -DependencyPackagePath

C:\Packages\MyPackage\MyDependencyPackage.msix -LicensePath C:\Packages\MyPackage\myLicense.xml

This article is from: