Installation breaks PATH on Windows
My machine got messed up so I went looking and I believe the code is here. The setx command limits variables to length 1024.
The proper solution is to write using the registry as that code in the first link does for reading.
Side note: I notice that setup adds C:\Users\ofek\AppData\Local\Volta\bin to the user PATH and C:\Program Files\Volta\ to the system PATH. For the latter, I would recommend removing the trailing backslash as it's unnecessary.
It may also be nice to broadcast the change across existing windows using the following:
- https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessagetimeoutw
- https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-settingchange
I'm glad the current behavior doesn't do that however because the only way I was able to recover the previous PATH was from printing it out in an existing window 😅
This is still broken.
Yeah the Volta installer just nuked half my PATH variable... :/ Good thing I still had VS Code open ._.