WinGet 1.30.310: User-scope portable package upgrades fail from a non-elevated terminal
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- cpp
- 领域
- authorization, cli
调研方向
The error is raised from the portable install flow at Workflows/PortableFlow.cpp:39, and the payload names EnsureNotRunningWithNonDefaultFullToken as the guard that checks the token. Start by reading how that guard decides between TokenElevationTypeFull and TokenElevationTypeDefault, then reproduce with a non-elevated terminal and winget upgrade --id GitHub.Copilot --exact --scope user. Done means a medium-integrity process can upgrade or uninstall user-scope portable packages, while an elevated process is still blocked. Read #6363 and #6634 first, since they set the current guard behaviour.
由索引模型根据 Issue 内容生成。
描述
Relevant area(s)
WinGet CLI
Relevant command(s)
winget upgrade
Brief description of your issue
WinGet v1.30.310 refuses to upgrade or uninstall user-scope portable packages from a non-elevated terminal. It fails with APPINSTALLER_CLI_ERROR_ADMIN_CONTEXT_ACTION_PROHIBITED (0x8a15007d), even though the process is not elevated and UAC is enabled.
Uninstalling the same packages from Windows Settings > Apps > Installed apps also fails, so there is currently no supported way to update or remove them.
This looks like the admin-context guard misdetecting the token. The guard was discussed in #6363 and broadened in #6634.
Affected packages so far: GitHub.Copilot (portable, user scope) and astral-sh.uv (portable, user scope).
Upgrading these applications with WinGet used to work. Over the past few weeks, an increasing number of installed applications have started failing to upgrade with this error. This appears to be a regression, but I don’t know the exact version or update that introduced it.
Steps to reproduce
- UAC is enabled (EnableLUA=1, FilterAdministratorToken=1). The user is a member of the local Administrators group.
- Open Windows Terminal or PowerShell normally from the Start menu, not "Run as administrator".
- Confirm the process is not elevated:
- Integrity level: Medium Mandatory Level (
whoami /groups) - TokenElevationType = 1 (TokenElevationTypeDefault), TokenIsElevated = 0
- Integrity level: Medium Mandatory Level (
- Have a user-scope portable package installed with an update available, for example:
- GitHub.Copilot 1.0.112 (1.0.114 available)
- astral-sh.uv 0.13.7 (0.13.9 available)
- Run any of:
winget upgrade --id GitHub.Copilot --exact --scope user
winget upgrade astral-sh.uv
winget uninstall --id GitHub.Copilot --exact - Alternatively, open Windows Settings > Apps > Installed apps, select one of these packages and choose Uninstall.
Expected behavior
The command runs from a non-elevated, medium-integrity process, so WinGet should upgrade or uninstall the user-scope portable package. The admin-context restriction should only apply when the process runs with a full (elevated) token.
Actual behavior
Every attempt is blocked and nothing is changed.
From the terminal:
L’opération demandée n’est pas autorisée à partir d’un contexte d’administrateur sur des packages installés dans l’étendue utilisateur.
(The requested operation is not allowed from an administrator context on packages installed in user scope.)
Exit code: -1978335107 (0x8a15007d, APPINSTALLER_CLI_ERROR_ADMIN_CONTEXT_ACTION_PROHIBITED)
WinGet log (%LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir):
Terminating context: 0x8a15007d at ...\Workflows\PortableFlow.cpp:39
The same happens with --disable-interactivity.
From Windows Settings > Apps > Installed apps, Uninstall also fails and the package stays installed.
Reading the source, EnsureNotRunningWithNonDefaultFullToken checks for TokenElevationTypeFull. The calling process token is TokenElevationTypeDefault (1) and not elevated, so the guard should not trigger.
I’m currently blocked from upgrading or uninstalling these packages through WinGet, and uninstalling them through Windows Settings also fails. I haven’t found a working workaround. Please let me know if there is a safe way to resolve this.
Related: #6363 (closed), #6634 (Broaden elevated process limitations).
WinGet-2026-11-23-13-16-06.595.log
Environment
[winget --infp]
Gestionnaire de package Windows v1.30.310
© 2026 Microsoft. Tous droits réservés.
Windows: Windows.Desktop v10.0.26200.9974
Architecture du système : X64
Package : Microsoft.DesktopAppInstaller v1.30.310.0
- 主要语言
- C++
- 星标
- 26.6k
- 派生
- 1.8k
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 42
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/winget-cli 的其他 Issue
-
Command-Install Needs-Triage
难度 2/5 1-3 小时 新手友好度 79/100
microsoft/winget-cli#6718 ·
维护者通常 2 天内回复
-
Issue-Docs Needs-Triage
难度 2/5 1-3 小时 新手友好度 70/100
microsoft/winget-cli#6692 ·
维护者通常 2 天内回复
-
Issue-Docs Possible-Duplicate
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/winget-cli#6493 · 1 条评论 ·
维护者通常 2 天内回复
-
Issue-Feature
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/winget-cli#6427 ·
维护者通常 2 天内回复
-
Issue-Docs msstore
难度 2/5 1-3 小时 新手友好度 64/100
microsoft/winget-cli#6331 · 1 条评论 ·
维护者通常 2 天内回复
查看 microsoft/winget-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
cp-algorithms/cp-algorithms#1774 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
telefonicaid/fiware-orion#4836 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
SanderMertens/flecs#2463 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 2 天内回复
-
nixd exits at startup when its parent process belongs to another user可能已有人在做 @conao3 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
nix-community/nixd#930 ·
维护者通常 2 天内回复