fix: do not truncate system PATH in win installer #5243
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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: