Skip to content
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

Installer improvements #457

Closed
noelhibbard opened this issue Jul 3, 2019 · 5 comments
Closed

Installer improvements #457

noelhibbard opened this issue Jul 3, 2019 · 5 comments

Comments

@noelhibbard
Copy link
Contributor

My windows account does not have admin rights so when I run the nvm installer it prompts for creds. When I type creds for an admin account the installer defaults to my correct user profile folder (not the admin's) but when it creates the %NVM_HOME% and %NVM_SYMLINK% vars and adds them to the %PATH% it's creating them in the admin's profile rather than my non-admin profile.

Inno Setup has an ExecAsOriginalUser function which will execute a program in the non-elevated environment which could be used to add the registry values to the correct HKCU.

For example:

ExecAsOriginalUser('REG', 'ADD HKCU\Environment /F /V NVM_HOME /D "' + ExpandConstant('{app}') + '"', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode)
ExecAsOriginalUser('REG', 'ADD HKCU\Environment /F /V NVM_SYMLINK /D "' + SymlinkPage.Values[0] + '"', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode)

Manipulating the path would require you to do REG QUERY and then parse the stdout. I just don't have time to mess with this right now. It would be great if these changes could be made to the installer though.

@coreybutler
Copy link
Owner

Thanks for this. I am pressed for time too, but if someone wants to take a shot at this, I'd accept a PR.

@noelhibbard
Copy link
Contributor Author

I will try to get to over the weekend sometime.

@noelhibbard
Copy link
Contributor Author

I created a pull request here: #459

@mcgwiz
Copy link

mcgwiz commented Feb 12, 2024

#459 was merged. Should this be closed?

@coreybutler
Copy link
Owner

@mcgwiz yes. Thanks for pointing that out.

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

No branches or pull requests

3 participants