Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

[Enhancement] Support an "Auto" scope, in addition to "Machine" and "User" #620

Open
jberezanski opened this issue Nov 22, 2014 · 0 comments

Comments

@jberezanski
Copy link
Contributor

Helpers such as Install-ChocolateyEnvironmentVariable are able to perform their work in per-user or per-machine (all users) scope. The latter is generally preferred (so that the installed package is correctly registered for all users), but requires administrative privileges.

If a package wants to support both per-machine (when running with administrative privileges) and per-user installations, it currently needs to explicitly handle both cases in code, e.g.:

if (Test-ProcessAdminRights) {
    Install-ChocolateyPath -pathType Machine ...
} else {
    Install-ChocolateyPath -pathType User ...
}

If a package does not specify the scope, User is assumed, which is inconvenient now that per-machine, administrative installation is the secure and recommended approach.

Let's add an "Auto" scope parameter value, which would be interpreted as Machine if user has administrative privileges and as User otherwise. This should also be the default scope, so that the amount of code required in typical packages is minimized.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants