Environment Variables
Previous Top Next


clip0306

Thinstall can set Environment variables just before your program is run. These environment variables will be visible only to your application and programs that it spawns. Any DLL used by your program or a spawned process would also see these environment variables. Other applications running on the same computer will not see these Environment variables. Environment variable values may include Thinstall expansion macros.

Click here for a list of possible expansion macros.

TS_VERSION
When this checkbox is selected, your program can call GetEnvironmentVariable("TS_VERSION", ...) to obtain the version of Thinstall used to compile your EXE.
You may want to include the version of Thinstall you built with in your debug and error logs to aid in remote trouble-shooting. By default this value is not set by Thinstall.

Examples of using Environment Variables.

1. Prepending or Appending to the PATH variable.
The Windows Operating System uses the Environment variable called PATH when trying to load a DLL through LoadLibrary, and also when locating a file through SearchPath. It may be useful to append or prepend %InstallPath% to the previous value of PATH. This can be done with following assignment.

Variable Name = PATH
Value = %InstallPath%;$PATH$

2. Adding to CLASS_PATH for JAVA Programs. For Java programs executed by a JRE such as MS Java, the CLASSPATH Environment variable is used to locate .class and .jar files to be loaded. Thinstall can be used to add the location of your class or jar files before the JRE is used.

Variable Name = PATH
Value = CLASSPATH=%InstallPath%\my_class_files_subdir