joyent/node — Issue #2407: Installer does not notify other apps after updating PATH
Author: joewhite
Created: 2011-12-23 01:59:46+00:00
State: open

I installed node-v0.6.6.msi on a Windows machine that had never had node.js installed before. The installer ran, and when it was done, it told me to open a command prompt and type `node`. I did, and the command prompt told me "`'node' is not recognized as an internal or external command, operable program or batch file.`"

When I looked in Control Panel > System > Advanced > Environment Variables, the PATH had been updated correctly. The installer apparently just didn't notify other running processes (specifically, Explorer) that they needed to reload their environment blocks. Since you use Windows Explorer (via the Start menu) to open the new command prompt, it inherits Explorer's environment block, and since its environment block hadn't refreshed, I couldn't open a command prompt and run node.

I tried uninstalling node and then reinstalling, and the problem persisted, which seems to rule out any kind of sporadic problem -- it looks like the installer simply isn't sending the necessary change notifications.

This would have fixed itself if I had rebooted, but that's a poor solution. I fixed it manually by making a trivial edit to the PATH environment variable (still in the Environment Variables dialog) and clicking OK, which did notify running processes of the change, so Explorer reloaded its environment block, and then everything was fine. But the installer should be sending the proper notifications automatically so everything works.

I'm not sure what you use to build your installer, but here's some info on the notification that needs to be sent: http://support.microsoft.com/kb/104011