PDA

View Full Version : Environment Vars?



shelden
10-01-2003, 09:23 AM
Fairly new to IS, so forgive the newbie question.

I have written a Setup.Rul script in an InstallScript-only project. However, there doesn't seem to be any way to append anything to the system path.

Do you need an MSI project to do that? The Environment Variables only seem to be hanging off System Configuration if it's an MSI project.

And, when I use the same Setup.Rul an MSI project, it hangs. :-(

Any suggestions? --Brian

jimshatt
10-30-2003, 11:30 AM
Hmm, I'm trying to do the same, unfortunately it does not seem to be possible in an InstallScript project...

Any tips and / or tricks?

RobCoon
10-31-2003, 05:25 PM
Hi.

Unfortunately, InstallScript projects currently do not have the same interface as MSI projects for modifying environment variables. However, it is possible to do this through script. See the Knowledge Base article Q107382 ( http://support.installshield.com/kb/view.asp?articleid=q107382 ) for an example.

pierceray
02-06-2004, 01:09 PM
There is a slight problem with this code in the KB article.

nResult = RegDBSetKeyValueEx(szKey, szEnvVar, REGDB_STRING, szValue, -1);

should be

nResult = RegDBSetKeyValueEx(szKey, szEnvVar, REGDB_STRING_EXPAND, szValue, -1);


The type of the key used needs to be changed to REGDB_STRING_EXPAND. Otherwise the type of the Path Environement variable is changed and the %<name>% entries in the Path variable are not expanded. This means that users will no longer have access to some basic command listed in the System32 folders.