microsoft / microsoft/winget-cli

Winget --scope machine not working for appx applications

Open
#3,553 6 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Command-Install Issue-Bug msstore
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

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
WinGet, version [1.5.1881]
OS: Windows.Desktop v10.0.19045.3324
Package: Microsoft.DesktopAppInstaller v1.20.1881.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing winget install smapone --scope machine on the stated Windows and WinGet versions, then inspect external/pkg/src/AppInstallerCLICore/Workflows/MSStoreInstallerHandler.cpp around the logged failure. Confirm the expected behavior for an Appx or Microsoft Store package and ensure a machine-scope install succeeds for all users without the reported context error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.