microsoft / microsoft/winget-cli

winget source fails to update when invoking via a secondary administrator account

Open
#5,385 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Brief description of your issue

My Windows configuration employs a secondary account which is granted admin rights. All UAC elevation prompts made from standard user accounts require entering this secondary "Admin" account's credentials. However, running PowerShell as Admin and running winget ugprade results in a failure to update the winget source repository as shown in the console output below. Winget operates normally when user accounts are added to the Administrators group via lusrmgr.msc, or when logging into the Admin account desktop.

PS C:\Windows\System32> whoami
PC\admin
PS C:\Windows\System32> winget upgrade
Failed in attempting to update the source: winget
Steps to reproduce
  1. Create separate Windows Administraor account
  2. Remove standard user account from the Administrator group
  3. Log out and log back in to the user account to refresh the changes
  4. Run PowerShell as administrator and enter the administrator account credentials to elevate
  5. Run winget upgrade
Expected behavior

winget upgrade should properly update source repositories for the latest packages

Actual behavior

winget upgrade fails to update the winget source repository for the latest packages. The lastest packages are unavailable.

Environment
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.26100.3775
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.25.390.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads
Configuration Modules              %LOCALAPPDATA%\Microsoft\WinGet\Configuration\Modules

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale


Group Policy                                State
---------------------------------------------------
Enable Windows Package Manager              Enabled
Enable Windows App Installer Default Source Enabled

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ProxyCommandLineOptions                   Disabled
DefaultProxy                              Disabled

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

Reproduce the failure by running winget upgrade after elevating PowerShell with the secondary administrator account, then inspect the diagnostic logs under %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir. Done means the winget source repository updates successfully and the latest packages are available in this account configuration.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.