Sending the WININICHANGE message to the broadcast address is the correct thing to do. However there is no requirement that all running processes correctly subclass that message and update their environment variables for that process. They are supposed to, but it doesn't always happen. The most notorious example of this is the Service Control Manager. You have to reboot for the SCM to see the new variable/value.
Now if you are asking "how do I get my current running process to see this value?" ( Cosmin seems to think that's what you are asking but I'm not sure if you are or not ) then the answer lies in understanding that the environment space has four collections:
User
Machine
Process
Volatile
http://msdn.microsoft.com/en-us/library/6s7w15a0(v=vs.85).aspx
What your code does is set the environment var for SYSTEM. This is like the old days when you would put a line in your autoexec.bat ( SET FOO=BAR ) and reboot. But you could also create a new dos prompt from windows and do SET SOMETHING=ELSE and it would only be seen for the life of that process and child processes but no other processes. This is the "Process" space vs the "System" space. Also if you updated AUTEXEC.BAT with a new variable and created a new process without rebooting it wouldn't see the new variable but you could always set it yourself and see it ( although not technically the same one ).
I know, with SendMessage you shouldn't need the reboot but regardless not all processes will get the message.
So, if you need the current InstallScript process to also have this new variable, you'll want to call Kernel32's SetEnvironmentVariable function which according to MSDN "Sets the contents of the specified environment variable for the current process."
Interesting InstallScript has a GetEnvVar function but not a SetEnvVar function so you'll have to prototype this as an external function and then call it.
A discussion with samples can be found here.