View Full Version : Set Path during install

12-13-2002, 06:09 PM
Hi all,
I am trying to build a script to install my application that uses a Sql Anywhere / Adaptive Server Anywhere (v6.03) database. Unfortunately, there is no merge module (is there ?) for this so I have assembled the files I need by hand and have them installing into my [INSTALLDIR]. The problem I am having is that during the installation, when it tries to setup the ODBC information for my ASA db, it fails with the message "Language Resource file not found". I know this is coming from the dbgen6.dll file that ASA uses. I have the script setting the PATH environment variable to include my [INSTALLDIR], but it seems that doesn't take effect until the end of the script and/or after a reboot Once the path is set, the ODBC configuration section of the install will work fine (I tested by using the Change / Repair options under Add / Remove Programs).
So, is there anyway to set the environment variable earlier in the installation process, or force the ODBC configuration to look in the proper directory ? Or do I need to make those files go to the system directory, so I know they will be on the path ?

01-06-2003, 03:10 PM
Seems strange because the installer executes the WriteEnvironmentStrings action before the InstallODBC action. Basically that means it writes environment variables before performing the ODBC install.

However it could be that the installer can't access environment variables it writes till the end of the setup. This is quite possible. If everything works fine with you putting the files in the System Folder it would be the cleanest approach. Otherwise try using the following VBScript as a custom action:

Set WshShell = CreateObject("WScript.Shell")
Set WshSysEnv = WshShell.Environment
WshSysEnv("PATH") = WshSysEnv("PATH") & ";C:\Test\Express"
msgbox WshSysEnv("PATH")

Please note that you will have to write a separate custom action to remove this entry during the uninstall.

01-06-2003, 03:53 PM
Hi Chandima,
Thanks for the response,
I ended up putting the files into the system folder, it was a cleaner install / uninstall and I then had no need to change the PATH variable.

Thanks again for your help