make winget run as admin instead of asking for admin on each installer #3185
-
Description of the new feature / enhancementcould it be possible to make winget run as admin and then run the installers as admin or user depending on if they need to install to appdata or program files Proposed technical implementation detailswinget is run as admin > winget runs installer either as admin or user based on manifest > install done |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
@Sakooooo we're doing some work now with the "elevatesSelf" property in the manifest to enlighten ourselves when a package will trigger UAC prompt. We're working on some scenarios where we can logically call a single UAC request for a set of packages to be installed in that context. Some users will not have the ability to elevate, and we need to be able to reason about that particular scenario as well. Interestingly, there are also packages that will not install in admin and we've added "elevationProhibited". In those cases, running in admin will fail, and we need to reason about "de-elevation" to some "appropriate" user account. |
Beta Was this translation helpful? Give feedback.
-
What about a scenario where the organization locks down user ability to run anything from winget themselves and only wants admins to be able to run it, period. |
Beta Was this translation helpful? Give feedback.
-
After starting PowerShell and entering the Failed when searching source: winget When I run powershell as a user, everything is fine, only the applocker cuts it. |
Beta Was this translation helpful? Give feedback.
-
Same here, PowerShell as administrator and An unexpected error occurred while executing the command: As user everything works fine, except the annoying step to enter administrator login on every install... |
Beta Was this translation helpful? Give feedback.
For that you can run PowerShell/CMD as administrator and accept the UAC prompt once and run
winget upgrade --all
- this would fail for packages that don't allow installation in an elevated context but to be fair those packages are a very small minority