winget-cli
winget-cli copied to clipboard
Unable to install programs which require Admin
Brief description of your issue
Winget is unable to install programs which require Admin.
Winget disables inheritance on the C:\Users\username\AppData\Local\Temp\WinGet
folder so the administrator accounts can't access it.
Even after manually enabling inheritance, the next winget install
disables it again and fails.
Steps to reproduce
winget install
any program that requires an Admin password
Expected behavior
The program installs.
Actual behavior
The program fails installing with the error The network name cannot be found
, or similar.
Environment
Windows Package Manager (Preview) v1.4.3132-preview
Copyright (c) Microsoft Corporation. All rights reserved.
Windows: Windows.Desktop v10.0.19045.2311
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.3132.0
@filiphorvat Can you run an instance of this with winget install <package> --verbose-logs
and share the log file? The location is displayed via winget --info
.
Here it is for winget install wiztree --verbose-logs
:
WinGet-2022-12-05-18-22-32.594.log
Looks like this after typing in the admin password:
Or like this when installing Steam:
Here's the log for Steam:
WinGet-2022-12-05-18-34-06.014.log
Even manually running the installer from the temp directory doesn't work if I don't re-enable inheritance.
same as me, my settings via winget settings
winver: Windows Server 2022 Standard 21H2 20348.1311
{
"$schema": "https://aka.ms/winget-settings.schema.json",
// For documentation on these settings, see: https://aka.ms/winget-settings
// "source": {
// "autoUpdateIntervalInMinutes": 5
// },
"telemetry": {
"disable": true
},
"network": {
"downloader": "wininet"
},
"source": {
"autoUpdateIntervalInMinutes": 360
},
//"logging": {
// "level": "verbose"
//},
"installBehavior": {
"preferences": {
"scope": "machine"
}
}
}
same as here https://github.com/microsoft/winget-cli/issues/2665
MS ignores it.
To install any programs with EXE Installers I do:
- Try first time winget update --id....
- Go into %TEMP%\Winget\
- Give to Administrator the permissions to access the applications's folder in %TEMP%\Winget
- Try second time winget upgrade --id...
Really good user experience....
The same behavior for me on Windows 11. Normal user without administrator rights tries to install a program with winget. Winget loads the installation files to C:\Users\USERNAME\AppData\Local\Temp\WinGet, sets own permissions. Full access for the current account and system and removes inheritance. The local administrator has no rights to the directory. Then WinGet requests the administrator rights. After that winget aborts with an error that it cannot access the installation files. Which was predictable if the local administrator lacks the rights. Apparently the Winget developers always work with administrator rights, otherwise they would have noticed the error immediately.
Can confirm we are able to replicate it on our tenant with onenote as it uses an exe As a workaround we are downloading it from the ms website It happens both on the store or through winget
Hi,
How about the feature where you can set the download directory for winget packages in settings file? Some directory where all the users has rw-rights.
I can confirm that this is fixed in 1.5 preview of winget. I really wonder why this bug even made it to a release. Does nobody really work without admin rights?
I can confirm that this is fixed in 1.5 preview of winget. I really wonder why this bug even made it to a release. Does nobody really work without admin rights?
Principle of least privilege says you shouldn't
same error Windows 11 22H2
the administrator account is being removed from the winget folder found in the temp folder every time the store reloads, why is this happening, Microsoft should be keeping the administrator privileges on this folder?