View Full Version : Environment variable

Saifadam Pathan
06-28-2004, 11:51 PM
Previously in IS Pro 6.2, i needed to create a new env var as well as remove it. All this functionality was done using a custom bit of InstallScript code that I wrote with the help available on IS community forums.
I understand that in IS X this process should be simple. Please let me know how this can be done in the IS X Professional Edition. I am unable to see any Environment Variable view in the Installation Designer tab. I use InstallScript project option while creating my projects.
Is this feature disabled in my version of IS X?


06-29-2004, 09:53 AM
The Environment Variables view is currently available only for projects that use Windows Installer; for pure InstallScript, you'll currently still need to use your script code.

Saifadam Pathan
07-07-2004, 11:40 PM
Too bad. I was hoping that the task of installing / un-installing env vars will be automated. As this would ensure that I dont have to check for OS type before doing the operation.

Thanks for the reply though.

Brandon Lowe
07-27-2004, 01:21 PM
I have to append the path variable for the first time and have just started to look for how to do this. Is there any chance you could post your code for this or email me a sample to point me in the right direction for doing it?



Saifadam Pathan
07-27-2004, 11:05 PM
Try these 2 functions. I have tested the AddPath(..) but not the RemovePath(...) function.

You may call the AddPath(...) as follows....

// Adds your TARGETDIR^lib folder to the Path Variable.

You may need to define these in your script

#define WM_WININICHANGE 0x001A
#define HWND_BROADCAST 0xffff

Hope this helps.

09-30-2004, 11:52 AM
Maybe you can use this tool for Win2K OS: Setx.exe


This command-line tool offers a batch method for setting environmental variables in the user or system environment and requires no programming or scripting. In addition to taking an environmental variable and its associated value from the command line, it can also get the values of registrykeys and write them to text files.

SetX provides the only command-line or programmatic way to directly set system environment values for Microsoft Windows 2000.

The SET command, which is internal to the command interpreter (Cmd.exe), sets only user environment variables for the current console window.

You can use SetX to set values for user and system environment variables from one of three sources: Command Line Mode, Registry Mode, or File Mode.

Brandon Lowe
09-30-2004, 12:08 PM
I'm using GetEnvironmentVariable and SetEnvironmentVariable and it is working great for me.