How to downgrade a provisioned package (with Add-AppxProvisionedPackage) using cmdline?

Kerenor 0 Reputation points

In our enterprise environment, we provision a packaged uwp app (packed as MSIX) with the cmd

Add-AppxProvisionedPackage -Online -SkipLicense -PackagePath [path-to-package].msix

Because we want all the user accounts on a device to have the same applications installed.

This works fine when having to install a newer version of an msix, but not when having to install a prior version. Specifically the error in this case is:

Add-AppxProvisionedPackage : Cannot create a file when that file already exists.

It looks like we need to install using an appinstaller file that specifies <ForceUpdateFromAnyVersion>true</ForceUpdateFromAnyVersion> , but Add-AppxProvisionedPackage does not support installing using an appinstaller file.

I came across this question about Provisioning Support for Appinstaller, however the methods specified there don't work for this scenario

  • The first method - doing this:
Add-AppxProvisionedPackage -SkipLicense -Online -PackagePath .\FileName.msix
Add-AppxPackage -AppInstallerFile .\FileName.appinstaller​

fails installing the lower-version package with Add-AppxProvisionedPackage with the same error as described above, the "file already exists" error

  • The second method - doing this:
$AppInstallerLocation = "C:\Users\MSIX\Desktop\AppInstallers\HeadTraxPkg_x64.appinstaller" [xml]$AppInstallerContent = [xml]$(Get-Content $AppInstallerLocation)

## Installs the AppxPackage
Add-AppxPackage -AppInstallerFile $AppInstallerLocation

## Forces the App to be Provisioned
$PackageFamilyName = $(Get-AppxPackage -Name $($AppInstallerContent.AppInstaller.MainPackage.Name) -Publisher $($AppInstallerContent.AppInstaller.MainPackage.Publisher)).PackageFamilyName
$PackageManager = new-object

  • fails installing the lower-version package with Add-AppxPackage with the following error
Add-AppxPackage : Deployment failed with HRESULT: 0x80070005, Access is denied.

So my question is - how can I install a lower version of a provisioned msix package, without uninstalling the existing one, from command line?


A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
1,294 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 41,106 Reputation points

    Hello there,

    Installation of earlier versions of an MSIX app package can be performed on a device without prior removal of the application. Triggering an installation of an earlier version of the same application will cause the client to review the app's manifest file contained within the installing MSIX app package. The review of the appxmanifest.xml file will identify delta differences between the currently installed app and the installer being executed on the device. This process maintains the data stored within the appdata folder. Any changes that were made when installing the upgraded version will not be undone if an earlier version of the MSIX app package is installed.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer--