WinGet 1.30.310: User-scope portable package upgrades fail from a non-elevated terminal

オープン
#6,701 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
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 の本文から書いたものです。

説明

Command-Upgrade Issue-Bug
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
  1. UAC is enabled (EnableLUA=1, FilterAdministratorToken=1). The user is a member of the local Administrators group.
  2. Open Windows Terminal or PowerShell normally from the Start menu, not "Run as administrator".
  3. Confirm the process is not elevated:
    • Integrity level: Medium Mandatory Level (whoami /groups)
    • TokenElevationType = 1 (TokenElevationTypeDefault), TokenIsElevated = 0
  4. 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)
  5. Run any of:
    winget upgrade --id GitHub.Copilot --exact --scope user
    winget upgrade astral-sh.uv
    winget uninstall --id GitHub.Copilot --exact
  6. 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時間
マージ済み PR(30日)
42

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/winget-cli のほかの issue

microsoft/winget-cli の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。