Can't install MSIX package with powershell

4

The problem

I am trying to install a .net core 3.1 wpf app onto a windows 2019 server using msix as the method of deployment. The windows server is up to date and should support msix, but will not install any msix package I create using the powershell command Add-AppPackage. The packages will install on windows 10 machines if you click on the .appinstaller file and use the gui, but they will not install on the same machine if you use powershell.

What I have tried

  • I've went through this troubleshooting page to no avail.
  • I have tried different msix packages
  • I have tried using a local file directory
  • I have tried running as administrator

Code

This is an example of what I am trying to install: appinstaller file Running the .appinstaller file will correctly install this uwp app. However, this will not work:

Add-AppPackage .\TestUwp.appinstaller

Error Message

This is the error message the powershell script outputs:

Add-AppPackage : Deployment failed with HRESULT: 0x80073CF0, Package could not be opened.
error 0x8007000D: Opening the package from location TestUwp.appinstaller failed.
NOTE: For additional information, look for [ActivityId] 742e8080-11e2-0000-5f0b-3374e211d601 in the
Event Log or use the command line Get-AppPackageLog -ActivityID 742e8080-11e2-0000-5f0b-3374e211d601
At line:1 char:1
+ Add-AppPackage .\TestUwp.appinstaller
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (W:\...\.appinstaller:String) [Add-AppxPackage],
   FileNotFoundException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPac
   kageCommand

PS W:\[file location here]> Get-AppPackageLog -ActivityID 742e8080-11e2-0000-5f0b-3374e211d601

Time                      ID           Message
----                      --           -------
4/14/2020 9:17:50 AM      603          Started deployment Add operation on a package with main
                                       parameter TestUwp.appinstaller and Options 0 and 0. See
                                       http://go.microsoft.com/fwlink/?LinkId=235160 for help
                                       diagnosing app deployment issues.
4/14/2020 9:17:50 AM      465          error 0x8007000D: Opening the package from location
                                       TestUwp.appinstaller failed.
4/14/2020 9:17:50 AM      403          error 0x8007000D: Failure to get staging session for:
                                       file:///W:/[file location here]/TestUwp.appinstaller.
4/14/2020 9:17:50 AM      404          AppX Deployment operation failed for package  with error
                                       0x80073CF0. The specific error text for this failure is: error
                                       0x8007000D: Opening the package from location
                                       TestUwp.appinstaller failed.
wpf
powershell
.net-core
deployment
msix
asked on Stack Overflow Apr 14, 2020 by Chris Evans

1 Answer

3

When you use:

Add-AppxPackage .\TestUwp.appinstaller

The path will be mapped to the positional parameter -Path. This parameter is designed to specify the path to the app package. But you are not installing the app directly. You are using an app installer file. To install from that, use:

Add-AppxPackage -AppInstallerFile .\TestUwp.appinstaller

With this command, I was able to install your package successfully.

answered on Stack Overflow Apr 22, 2020 by stackprotector • edited Apr 26, 2020 by stackprotector

User contributions licensed under CC BY-SA 3.0