-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Winget --scope machine not working for appx applications #3553
Comments
Looking at the code, I see this comment:
Tracing back, it was initially added by @yao-msft in this PR - In this case, based on the code, the expected behavior is that the appx application should be blocked from install under the machine scope until the OS bugs have been fixed. |
This should provision AppX Packages system wide so all users get them w/ registrations so they appear in the users space and for uninstall 'unprovision the appx package' |
You can install machine wide apps with current OS APIs. See Add-AppxProvisionedPackage, it installs an Appx as part of windows image, at next login or new user login, they will register it. If there is an update, the app may update an re-registered by store/PMAPI in user context. Winget should perform equivalent functionality to add-appxprovisionedpackage when performing machine install of modern apps. |
Here is what we expect winget to do, but it falls completely short of being able to do:
The core reasons for this are the Store for Business being pulled and support for WSFB being pulled from SCCM. We manage machines that are multi-user and don't want 50 or 100 copies of the apps installed on machines for each user and prefer the app be system provisioned and registered for each user instead. We also want to ensure apps on machines are up to date from the store by forcing a winget update on all of them, even the Out Of Box apps such as Notepad or MSPaint. There are a ton of people apparently trying to do this or similar via PowerShell per https://techcommunity.microsoft.com/t5/windows-it-pro-blog/use-winget-1-8-to-download-microsoft-store-apps/ba-p/4204522 |
Maybe Microsoft should make Store apps installable system-wide instead of duplicating a copy of the same app for every user. That was a weird decision to begin with and is wasteful at best. No other OS does this, mobile or desktop. |
Brief description of your issue
Installing Appx applications with Winget in a machine --scope machine context does not work. We want to install it for all users of a machine Windows 10 22H2.
For instance when trying to install the appx smapone app
Winget install smapone --scope machine
We enabled debug logging and we got this result:
023-08-24 14:49:39.371 [CLI ] Device wide install for msstore type is not supported under admin context.
2023-08-24 14:49:39.371 [CLI ] Terminating context: 0x8a150113 at D:\a_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\MSStoreInstallerHandler.cpp:b7
Despite the error in the logs the scope machine for Winget required admin rights.
At the moment we are installing it like this, but it does not install for all users.
winget install $app --verbose --accept-source-agreements --accept-package-agreements --silent
Your help is appreciated.
Steps to reproduce
For instance when trying to install the appx smapone app
Winget install smapone --scope machine
results in error
023-08-24 14:49:39.371 [CLI ] Device wide install for msstore type is not supported under admin context.
2023-08-24 14:49:39.371 [CLI ] Terminating context: 0x8a150113 at D:\a_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\MSStoreInstallerHandler.cpp:b7
Expected behavior
The expected behavior is that the appx application should install for all users under the machine scope.
Actual behavior
We are failing to install the appx package under the machine scope.
Environment
The text was updated successfully, but these errors were encountered: