Winget is broken with BlockNonAdminUserInstall being set

未关闭
#6,499 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp, powershell

调研方向

首先,在设置了 BlockNonAdminUserInstall 的情况下,使用 winget install、winget upgrade 和 winget repair 重现该问题,并检查报告的 AddPackage “access-denied”失败。跟踪如何为非管理员用户添加 WinGet 源包,以及如何处理提权。当有可用的辅助管理员帐户时,这些命令能够安装软件,即视为完成。

由索引模型根据 Issue 内容生成。

描述

Command-Install Command-Repair Command-Upgrade Issue-Bug
Relevant area(s)

WinGet CLI

Relevant command(s)

winget install, winget upgrade, winget repair

Brief description of your issue

On machines with BlockNonAdminUserInstall = 1 being set, its impossible to use winget

Steps to reproduce

Our IT provisions our developer machines with an ENTRA/firstName.lastName account without admin rights and sets HKLM:\SOFTWARE\Microsoft\PolicyManager\current\device\ApplicationManagement\BlockNonAdminUserInstall = 1 via Intune.
They grant us the ability to install software via a secondary ENTRA/adm-firstName.lastName account with admin rights.

Trying to use winget install for anything on the winget source leads to

Unexpected error while executing the command:
0x8a15000f : Data required from the source is missing

This is due to AddPackage on the Microsoft.Winget.Source failing with 0x80070005 (access denied).
Since this is a per-user package, the adm account doesn't help here.

Expected behavior

Being able to install software with winget, if needed by using elevate.

Actual behavior

Installing software is impossible with BlockNonAdminUserInstall being set on a non admin account, even if a secondary admin account is available.

Environment
winget --info
Windows-Paket-Manager v1.29.280
© 2026 Microsoft. Alle Rechte vorbehalten.

Windows: Windows.Desktop v10.0.26200.9106
Systemarchitektur: X64
Paket: Microsoft.DesktopAppInstaller v1.29.280.0

WinGet-Verzeichnisse
-----------------------------------------------------------------------------------------------------------------------------------------
Protokolle                                   %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
Benutzereinstellungen                        %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Verzeichnis für portierbare Links (Benutzer) %LOCALAPPDATA%\Microsoft\WinGet\Links
Portables Linkverzeichnis (Computer)         C:\Program Files\WinGet\Links
Portierbarer Paketstamm (Benutzer)           %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portierbarer Paketstamm                      C:\Program Files\WinGet\Packages
Portierbares Paketstamm (x86)                C:\Program Files (x86)\WinGet\Packages
Installationsprogrammdownloads               %USERPROFILE%\Downloads
Konfigurationsmodule                         %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules

Links
-----------------------------------------------------------------------------------------
Datenschutzerklärung              https://aka.ms/winget-privacy
Lizenzvereinbarung                https://aka.ms/winget-license
Hinweise von Drittanbietern       https://aka.ms/winget-3rdPartyNotice
Startseite                        https://aka.ms/winget
Windows Store-Nutzungsbedingungen https://www.microsoft.com/en-us/storedocs/terms-of-sale

Administratoreinstellung                  Status
-----------------------------------------------------
LocalManifestFiles                        Deaktiviert
BypassCertificatePinningForMicrosoftStore Deaktiviert
InstallerHashOverride                     Deaktiviert
LocalArchiveMalwareScanOverride           Deaktiviert
ProxyCommandLineOptions                   Deaktiviert
ConfigurationProcessorPath                Deaktiviert
DefaultProxy                              Deaktiviert
主要语言
C++
星标
26.6k
派生
1.8k
平均合并
3 天 10 小时
30 天内合并 PR
41

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/winget-cli 的其他 Issue

查看 microsoft/winget-cli 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。