Old 19th July 2002, 17:28   #1
skldhxr
Junior Member
 
Join Date: Jul 2002
Posts: 4
Question 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 )
skldhxr is offline   Reply With Quote
Old 19th July 2002, 17:34   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 19th July 2002, 17:50   #3
skldhxr
Junior Member
 
Join Date: Jul 2002
Posts: 4
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?)

:: skldhxr ::

Last edited by skldhxr; 19th July 2002 at 18:06.
skldhxr is offline   Reply With Quote
Old 19th July 2002, 19:07   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Glad I can help

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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 19th July 2002, 21:06   #5
skldhxr
Junior Member
 
Join Date: Jul 2002
Posts: 4
Cool

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)


..(_`·.: ..:: skldhxr ::.. :.·`_)..
skldhxr is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump