Foundry-Local icon indicating copy to clipboard operation
Foundry-Local copied to clipboard

Install MSIX with machine scope

Open natke opened this issue 6 months ago • 5 comments

Running into a related issue: winget install works on my end ...

PS C:\Users\maxhorstmann> winget install Microsoft.FoundryLocal Found Foundry Local [Microsoft.FoundryLocal] Version 0.3.9267.43123 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. This package requires the following dependencies:

  • Packages Microsoft.VCLibs.Desktop.14 [>= 14.0.33728.0] Successfully verified installer hash Starting package install... ██████████████████████████████ 100% Successfully installed ... but not with machine scope:

PS C:\WINDOWS\system32> winget install Microsoft.FoundryLocal --scope machine Found Foundry Local [Microsoft.FoundryLocal] Version 0.3.9267.43123 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. This package requires the following dependencies:

  • Packages Microsoft.VCLibs.Desktop.14 [>= 14.0.33728.0] Successfully verified installer hash The current system configuration does not support the installation of this package. Machine scope support would be useful e.g. to include Foundry Local in a Dev Box image.

A system-wide install appears to be generally possible when using the installer directly:

Add-AppxPackage -Path "FoundryLocal-x64-0.1.9218.19650.msix"

@MaxHorstmann

AB#69000

natke avatar May 23 '25 18:05 natke

Should this be moved to the winget-cli repo? Hey @florelis and @denelon - any idea why the --scope machine doesn't work here?

MSIXes are "kind of" machine scope already, in that their bits are shared between users, though every user has to request it be installed on their own.

For now, the workaround is to use Add-AppxProvisionedPackage ... follow the instructions in the README.md and download the packages then use Add-appxprovisionedpackage -online -packagepath .\FoundryLocal.msix -DependencyPackagePath .\VcLibs.appx -SkipLicense (in an elevated CMD of course.) That'll make it "machine wide" in that every user who logs in gets the package registered for them automatically. The Dev Box image configuration instructions explain how to add arbitrary downloads and script when building out an image.

jonwis avatar May 23 '25 20:05 jonwis

Looking at the winget code it seems we intentionally block installing MSIX machine-wide when using winget.exe due to an OS bug when calling the provisioning API from a packaged context. Maybe @JohnMcPMS knows what that bug was about.

Edit: @yao-msft made the change in microsoft/winget-cli#2855

florelis avatar May 23 '25 21:05 florelis

The workaround worked, thanks @jonwis!

Would be nice to get ultimately get it fixed in WinGet for easier configuration in DevBox customizations.

MaxHorstmann avatar May 23 '25 22:05 MaxHorstmann

The OS bug was fixed some time ago but was not backported. We (winget) could try out the fix and unblock on later versions of the OS.

yao-msft avatar May 23 '25 23:05 yao-msft

Thanks folks, we will document the workaround and hopefully can be improved in winget

natke avatar Jun 27 '25 19:06 natke