microsoft / microsoft/winget-cli
[Package Issue]: `Notepad++.Notepad++` - Elevated User No Perms on `$env:Temp\Winget`
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 26.4k
- Forks
- 1.8k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 15
Description
Please confirm these before moving forward
- I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
- I have not been informed if the issue is resolved in a preview version of the winget client.
Category of the issue
Installation issue.
Brief description of your issue
I couldn't upgrade Notepad++ because my elevated user could not access my current users $env:TEMP\Winget folder.
I run winget upgrade --id Notepad++.Notepad++ --exact as a non Administrator ( e.g. not in the Administrators group). winget writes out the npp installer to $env:TEMP\WinGet. The UAC prompt asks me to elevate which I do as another local user. The upgrade fails because it can't touch the aforementioned folder. This folder's permissions are automatically set and reset upon each run to only be accessible by SYSTEM or the current user.
Steps to reproduce
winget upgrade --id Notepad++.Notepad++ --exact as a non-Admin user and then elevate with a different local user.
Actual behavior
Installer fails with a pop-up that it can't access the path.
Expected behavior
Upgrade should complete successfully.
Environment
Windows Package Manager v1.4.10173
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.19045.2486
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.10173.0
Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Screenshots and Logs
No response
Workaround
I used add-localgroupMember -Member 'user' -Group 'Administrators' and then did winget upgrade and then remove-localgroupmember -Member 'user' -Group 'Administrators'.
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
Start by reproducing winget upgrade --id Notepad++.Notepad++ --exact as a non-Administrator user, then elevate with a different local user and inspect the diagnostic logs in %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir. Done means the Notepad++ upgrade completes without granting the original user temporary Administrator membership.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli, operating-systems, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100