As we know, it is perfectly possible to run MSIX packages in Windows Sandbox manually:
Add-AppxPackage -Path mySetup.msix
Even Developer mode like they say in the cited question is not mandatory. I was able to run MSIX without Developer mode.
Where the problems come are the dependencies. For example, AppInstaller has a lot of dependencies, and installing it this way manually in Sandbox fails:
Dependency 1:
PS C:\Users\WDAGUtilityAccount\Downloads> add-appxpackage -Path ".\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" add-appxpackage : Deployment failed with HRESULT: 0x80073CF3, Package failed updates, dependency or conflict validation. Windows cannot install package Microsoft.DesktopAppInstaller_1.23.1911.0_x64__8wekyb3d8bbwe because this package depends on a framework that could not be found. Provide the framework "Microsoft.UI.Xaml.2.8" published by "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x64 processor architecture and minimum version 8.2310.30001.0, along with this package to install. NOTE: For additional information, look for [ActivityId] 0dae5ec2-f854-000e-4fa2-af0d54f8da01 in the Event Log or use the command line Get-AppPackageLog -ActivityID 0dae5ec2-f854-000e-4fa2-af0d54f8da01 At line:1 char:1 + add-appxpackage -Path ".\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe. ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (C:\Users\WDAGUt...bbwe.msixbundle:String) [Add-AppxPackage], IOException + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
Dependency 2:
PS C:\Users\WDAGUtilityAccount\Downloads> add-appxpackage -Path ".\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" add-appxpackage : Deployment failed with HRESULT: 0x80073CF3, Package failed updates, dependency or conflict validation. Windows cannot install package Microsoft.DesktopAppInstaller_1.23.1911.0_x64__8wekyb3d8bbwe because this package depends on a framework that could not be found. Provide the framework "Microsoft.VCLibs.140.00.UWPDesktop" published by "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x64 processor architecture and minimum version 14.0.30704.0, along with this package to install. NOTE: For additional information, look for [ActivityId] 0dae5ec2-f854-000d-13e2-ae0d54f8da01 in the Event Log or use the command line Get-AppPackageLog -ActivityID 0dae5ec2-f854-000d-13e2-ae0d54f8da01 At line:1 char:1 + add-appxpackage -Path ".\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe. ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (C:\Users\WDAGUt...bbwe.msixbundle:String) [Add-AppxPackage], IOException + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
The above MS article recommends to use winget for automatically resolving (and installing) the dependencies along with the main package, but winget is not available without working MS Store (i.e. not available in Sandbox)
The WinGet tool will not be available until you have logged into Windows as a user for the first time, triggering Microsoft Store to register Windows Package Manager as part of an asynchronous process
Making things worse, preview versions of winget are distributed only via MSIX package which is recursive dependency, so it is effectively dead end for me. I cannot install AppInstaller in Sandbox without WinGet and vice versa.
Anybody ever tried to install complex MSIX packages on Sandbox?
UPDATE 10/11/24: an example where the Owen's approach doesn't fully work: I install the MSIX package by your suggested way. I used the Teams MSIX installer to try the approach
dism.exe /online /add-ProvisionedAppxPackage /PackagePath:.\Downloads\MSTeams-x64.msix /SkipLicense
The operation was completed successfully
However when I try to run Teams installed from MSIX I am getting this error
So looks like your way doesn't recognize and fetch all the dependencies from the MSIX manifest file. That is why WebView2 package was not installed with the Teams.
You can install the AppInstaller package using DISM.exe
. I did this using the 1.8.1911 release via GitHub, manually downloading it in the web browser, keeping the file and then unblocking the file (right click - properties - unblock):
dism.exe /online /add-ProvisionedAppxPackage /PackagePath:.\Downloads\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle /SkipLicense
That doesn't throw an error, and the AppInstaller is listed when running Get-AppxPackage -Name Microsoft.DesktopAppInstaller
, but that doesn't automatically pull down the dependencies.
Does installing via DISM.exe
solve your issue with your specific MSIX bundle, as I know you're not really asking about how to install the Microsoft.DesktopAppInstaller
specifically.
If you know the dependencies of your specific MSIX bundle, and have them available, you can update the DISM command with the /DependencyPackagePath
parameter and their location.
Now, this does add the package to the provisioned packages list, but I'm not sure if that will matter for your use case given we're talking about a Sandbox.