I’m setting permanent environment variables from an NSIS installer like described in the NSIS wiki. That works as expected, the variable is available to new processes after the installation.
However, when using the option to launch the installed program at the end of the installation, the environment variable is not available for that program started from the installer. I assume this is because the program started there has the installer process as parent and gets the same environment block (see the lpEnvironment argument of the createProcess function).
How can I make the program started from the last page of the installer see the newly set environment variable? Writing a custom launch function instead? The documentation does not say anything about the environment block of the Exec function.
You also need to use the Setting Environmental Variables Temporarily code if you want child processes to inherit the (updated) environment because only explorer.exe responds to the WM_WININICHANGE notification.