Problem with adding a new environment var and appending that to the PATH
Hello,

i am pretty new to NSIS and currently trying to build an installer for a piece of software.
During the installation process i add a new environment variable (JAVA_HOME), send a windows message 'to refresh the environment', append %JAVA_HOME%\bin to the PATH environment variable and 'refresh the environment' again.

the problem i am struggling with: If i open up a command shell after the installation and do an 'echo %JAVA_HOME%' it perfectly resolves the variable and echoes the path to the java dir. However it does not resolve %JAVA_HOME% within the PATH environment variable. If i do a 'set path' i get '[...]; %JAVA_HOME%\bin' :confused:
If i manually open up the environment variable dialogue and press the OK button in order to manually refresh the environment it works fine. Likewise if i set the reboot flag and tell the system to reboot after the installation has finished... :cry:

To be honest i would love not to force the users to reboot just because of the environment variable.

Any ideas..?

Thanks a lot in advance!

Best regards

Moxl