Archive: env vars in win.all


env vars in win.all
hi!

i'm farily new with the NSIS installer, and my next project is to try and make some installers for common GNUish utils on windows platforms. I found that i need to set some environment variables for some utils to work, and in the NSIS docs, i cant find any command for setting env vars, only read them (ReadEnvStr)..

So how do i put new enviromnent vars into windows? i found the registry key HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment in the Win2000 registry but a friend told me he didnt find the key on his 98 box. that left out the registry hacking option. So, how do i set a env var with nsis ?? or could i make nsis just run a .bat file with only 'set blah=blah' in it?

skldhxr
(be sure to check my matrix screensaver (beta version for a few more days), just follow my url->projects->starmatrix...made w/nsis installer too :)):weird:


To add environment variables in Win9x you need to put it in the autoexec.bat file. Your Windows 2000 registry "hack" is the way to go on Windows NT.

If you want an example of changing environment variables in Win9x and Win NT (current user only) you can look at my Path script over here:
http://www.clantpa.co.uk/nsis/wiki/index.php/Path


thanks
thanks, that script was just what the doctor ordered. i never realized nsis code could look that good :) very inspiring. well, off to finishing my installer!

btw, what exactly does refreshenv.exe do? i ask because i think i once saw an util that let you change 9x env vars w/o reboot...does it do that? (cant really tell from the win32 code right away) (and can i use it?)

:up: :: skldhxr :: :D


Glad I can help :D

RefreshEnv.exe only works on Windows NT, and it lets you apply the changes without logging in and out/rebooting. My script automatically uses it if it is used on Windows NT.
I have never heard of such a utility for Win9x. If you can find it again I will be very greatful.


i will do a search for that util and report here if i'm lucky. i'm pretty sure it was such an util. maybe we can make a refreshenv.win.all.exe, that'd solve a lot of problems. (as over 60% still use win98)


:up: ..(_`·.: ..:: skldhxr ::.. :.·`_).. :cool: