microsoft / microsoft/winget-cli
Sources don't update if something that would update the sources (winget show, for example) is run from an elevated CMD window in an account that's not in the Administrators group.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Brief description of your issue
Doing something that updates winget's sources from an elevated CMD/PowerShell window while logged into a user account that's not in the Administrators group doesn't actually update the sources.
Steps to reproduce
Note: winget will need to be installed in both accounts. Installing it in the account that's in the Administrators group will ask you to re-install, but in reality it's not installed in that account yet. winget may also complain about sources being broken after re-installing and trying to run from the account that's not in the Administrators group, but I haven't noticed this while verifying this issue.
Note 2: There will need to be a "Standard" account (according to what the Windows 10 Settings app calls accounts not in the Administrators group) in addition to an account with Administrator permissions, which is being referred to here as "Admin" to make it shorter.
- Open an elevated CMD/PowerShell window from the account that's not in the Administrators group.
- Run
winget show > (a text file somewhere that you'll check later) - Open a non-elevated CMD/PowerShell window from the same account.
- Run
winget show > (a text file with a different name from the earlier one; you'll check this one later, too). - Compare the two text files and notice that the progress bar goes from 0% to 100% in the elevated prompt output, while it gradually increases as expected in the non-elevated prompt output. An example is pasted in the "Actual behavior" section.
Reproduction steps were changed to use ones that may be more easily reproducible.
Expected behavior
The sources should be updated just like they would be if you used a non-elevated CMD/PowerShell window.
Actual behavior
Sources don't actually update even though winget says they were updated. If you do something that updates the sources in a non-elevated window (winget show, for example) then try to do the same thing in the elevated window, it acts as if the sources were updated, even though they weren't updated in the elevated window.
I ran winget show first in the elevated prompt first and directly afterward ran it in the non-elevated prompt, and sent its output to a text file both times. Since it keeps the progress bar in the output, I've pasted them here:
Elevated:
██████████████████████████████ 383 KB / 383 KB
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 0%
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 0%
██████████████████████████████ 383 KB / 383 KB
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 0%
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 0%
Non-elevated run directly after the elevated one:
██████████████████████████████ 383 KB / 383 KB
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 0%
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 0%
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 1%
█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 4%
█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 5%
█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 6%
██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 7%
██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 9%
███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 10%
███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 12%
███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 13%
████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 14%
████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 16%
█████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 18%
██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 23%
█████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ 44%
███████████████████████▒▒▒▒▒▒▒ 77%
███████████████████████▒▒▒▒▒▒▒ 77%
███████████████████████▒▒▒▒▒▒▒ 78%
██████████████████████████████ 100%
Environment
[winget --info]
Windows Package Manager v0.1.42101 Preview
Windows: Windows.Desktopv10.0.18362.959
Package: Microsoft.DesktopAppInstaller v1.10.42101.0
Any other software? None relevant to this issue.
This was verified in winget v0.1.42101 on my primary desktop.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source files or tests are named. Reproduce the issue with winget show from elevated and non-elevated CMD or PowerShell sessions under a Standard account, then trace the source-update path. Done means elevated and non-elevated runs both actually update the sources and show consistent progress.
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
- 25/100