Description
The Windows installer script at https://github.com/coder/coder/blob/main/scripts/win-installer/path.nsh overwrites the system PATH environment variable incorrectly.
Currently the install script:
- Reads from HKEY_CURRENT_USER\Environment\Path:
System::Call "advapi32::RegOpenKey(i 0x80000001, t'Environment', *i.r3) i.r4"
-
Appends the new coder folder
-
Writes to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment:
WriteRegExpandStr ${Environ} "PATH" $0
This causes a loss of the system environment variable (overwirtten by the user environment variable).
Perhaps reading from the system environment variable with something like:
System::Call "advapi32::RegOpenKey(i 0x80000002, t'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', *i.r3) i.r4"
Should fix.