8000 fix: do not truncate system PATH in win installer by deansheather · Pull Request #5243 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

fix: do not truncate system PATH in win installer #5243

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

Merged
merged 2 commits into from
Dec 1, 2022

Conversation

deansheather
Copy link
Member
@deansheather deansheather commented Dec 1, 2022

The path.nsh script in the NSIS installer provided methods for adding paths to the PATH and removing them. It would do this by reading the current PATH value from the registry, adding the new value (if it doesn't exist) and then writing it to the registry.

Unfortunately, it would read from the user's PATH and write the updated result to the system PATH, which would remove important PATH entries like the following in the process:

  • C:\Windows\System32
  • C:\Windows
  • C:\Windows\System32\wbem
  • C:\Windows\System32\WindowsPowerShell\v1.0
  • C:\Windows\System32\OpenSSH
  • C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
  • C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common

and would copy all user environment variables in their place. The variables listed above were the ones missing from my machine when I compared with a friend's machine.

The existing installers for the last couple of versions of Coder have been yanked from GitHub releases and this message will be included in the release notes for the next patch.

This patch has been tested to ensure that it doesn't copy PATH from user to system.

Thanks to @cmor for finding and reporting this bug. Closes #5240

Recommended course of action for affected users:

  1. Add the paths listed above to your system PATH if they aren't there already and exist on your system.
  2. Remove any paths that are in your user's PATH from your system PATH.

The path.nsh script in the NSIS installer provided methods for adding
paths to the PATH and removing them. It would do this by reading the
current PATH value from the registry, adding the new value (if it
doesn't exist) and then writing it to the registry.

Unfortunately, it would read from the user's PATH and write the updated
result to the system PATH, which would remove important PATH entries
like the following in the process:

- C:\Windows\System32
- C:\Windows
- C:\Windows\System32\wbem
- C:\Windows\System32\WindowsPowerShell\v1.0
- C:\Windows\System32\OpenSSH
- C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
- C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common

and would copy all user environment variables in their place. The
variables listed above were the ones missing from my machine when I
compared with a friend's machine.

Recommended course of action for affected users:
1. Add the paths listed above to your system PATH if they aren't there
   already and exist on your system.
2. Remove any paths that are in your user's PATH from your system PATH.

The existing installers for the last couple of versions of Coder have
been yanked from GitHub releases and this message will be included in
the release notes for the next patch.

Thanks to @cmor for finding and reporting this bug in #5240.
@deansheather deansheather merged commit 9e80322 into main Dec 1, 2022
@deansheather deansheather deleted the dean/fix-path-win-installer branch December 1, 2022 23:56
@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows installer wipes system PATH environment variable
3 participants
0