-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chocolatey GUI doesn't elevate with a standard Windows user account #511
Comments
You don't realize it, but you've stumbled on one of the longest fought issues on Gui :). /cc @gep13 |
As @RichiCoder1 said, this is a long, drawn out discussion. In the run up to the last release, we did have something similar to what you have shown, but in the spirit of simplicity, we took it out again. Coupled with the fact that Chocolatey has a self service mode, where a non admin can do the installation as well, it was felt that this was a better fit for now. |
It looks like this is for the Business Edition only...? Is this correct? I'm a private user using a non-admin account for enhanced security. |
That is correct. We are trying to make Chocolatey GUI work in the best way possible, while catering to all use cases. |
Hi @RiseT - we set the execution privilege to
This means if your account is a non-administrator it won't ask for UAC. If your account is an administrator, it will ask for administrative permissions on startup. I'm not even sure we had things set up the way you are describing when we were looking at a much more complex route to asserting UAC at runtime (complete non-admin, having admin credentials pop for run as). |
Related to
Subprocess issues:
|
Perhaps there may be an opportunity to approach this again in the future. Currently after a 9 month dive down a rabbit hole, the scars are maybe too fresh to approach this. However if I understand your approach correctly, you are looking for more the UAC into a totally different user (aka "Run As"). If there is something that could easily support that and still have things be very debuggable, I'm guessing we might approach that use case. The administrator with UAC will get elevated when starting Chocolatey GUI and I think we are fine with that scenario for now. |
Example: Currently, when I run ChocolateyGUI from the user account "Daily Work", every package installation, etc will fail without prompting for the password of the user account "Admin" and without elevating privileges. Of course, using "Run as administrator" in the context menu of ChocolateyGUI prevents this. But in ChoclateyGUI, a) a non-admin user should have a possibility to check if there are package updates available, and b) if that user discovers that there are indeed updates available, there should be a way to elevate (via entering a password) & upgrade without having to exit and restart ChocolateyGUI. |
@RiseT yes, that's exactly where I thought you were going. I am not even sure if the subprocess bits we had implemented wrapped this scenario or not. This would be something we can strive for eventually. It's unfortunately not as straightforward to implement as one might hope. |
@ferventcoder Yup, the subprocess did that. The issue was mostly A) we piped everything to the subprocess, even if it didn't require privileges and B) the subprocess was very fault intolerant and the RPC was kinda hacky. |
There's a related issue for this scenario (using Chocolatey with a standard/non-admin user account), although that might be a problem of Chocolatey itself rather than Chocolatey GUI: The installer of some applications installs them on a per-user basis (e. g. in "Users\Username\AppData"). Since - when using a non-admin user account - Chocolatey always needs to elevate to an account that does have admin privileges, the result is an installation of that application in "Users\Admin\AppData") rather than in "Users\Non-Admin\AppData"). Thus, the application cannot get accessed/used by user "Non-Admin". |
The fix should be very simple no?
|
Currently, when launching ChocolateyGUI v0.15.0 on a standard Windows user account (non-admin), there's no UAC password prompt, i. e. it doesn't ask for elevation.
Consequently, when trying to install, update or uninstall a package with ChocolateyGUI, it fails as of missing privileges.
As a convenient solution, rather than solving this by elevating when launching ChocolateyGUI, I suggest not elevating until the moment the user issues a command that needs elevation (e. g. the Update All button) for the first time for that session.
That way, the user can still e. g. check if there are any app/package updates without getting the UAC prompt and having to enter the admin password each time.
Currently, I'm often launching ChocolateyGUI without admin privileges in order to check if there are any package updates, and if this is the case, I quit ChocolateyGUI an re-start it via right clicking and "Run as administrator".
Here's an example of what I mean (i. e. the type of button or context menu command):
The text was updated successfully, but these errors were encountered: