Scoop icon indicating copy to clipboard operation
Scoop copied to clipboard

fix(system): add admin rights check for global path variable addition

Open gigberg opened this issue 8 months ago • 0 comments

This influences scoop shim add myapp args -g command. If global shimdir is not in global path by previous scoop install main/myapp -g command, you'll encounter error when run scoop shim add myapp args -g first time.

Let's use command scoop shim add myapp cmd.exe args -g for example: Before, if we don't have global shim dir in global path: image

The error message "$envRegisterKey = $registerKey.OpenSubKey('Environment', $true) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Exception calling "OpenSubKey" with "2" argument(s): "Requested registry access is not allowed." means we need admi privilege to perform this command.

After, if we apply this pull request and run the same command again: image The error message would be more clarified.

gigberg avatar Apr 16 '25 13:04 gigberg