winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

[Package Issue]: `Notepad++.Notepad++` - Elevated User No Perms on `$env:Temp\Winget`

Open mattcargile opened this issue 2 years ago • 2 comments

Please confirm these before moving forward

  • [X] I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
  • [X] 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 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'.

mattcargile avatar Feb 03 '23 19:02 mattcargile

@denelon - This seems like a cli bug

Related to https://github.com/microsoft/winget-cli/pull/2370 and https://github.com/microsoft/winget-cli/pull/2324

Trenly avatar Feb 04 '23 05:02 Trenly

I am not positive, but this seems like it is related to a comment that I just put in this issue:

https://github.com/microsoft/winget-cli/issues/2123

Also, for what it's worth, I am not using the CLI. I am using the graphical Microsoft Store. But I almost don't think it's even related to that, either, because I can literally stick any *.exe file in the Temp\WinGet folder and have the same problem. There is something unique to the WinGet directory that causes this. It almost seems like something in Windows itself is treating this directory differently. I can copy an *.exe from the WinGet folder and put it inside the general Temp folder and not have this issue.

I originally noticed this issue with OneNote and VLC Player, which also use *.exe files to install.

designatedsuccessor avatar Feb 08 '23 16:02 designatedsuccessor