views:

117

answers:

1

I am trying to do have a global string in Installshield so I can access it in multiple places. This is my first run at scripting in it. Here is what I have:

STRING DIR;

....

DIR="c:\\tempdir";

function Completed_Action()
begin
    // Here is where I try to access the DIR string.

It keeps giving me errors though. Is there any way to have a global string and set it's value before any functions? I should also add that this is in a sub rul script that is called after the main Setup.rul.

Thanks in advance.

+3  A: 

If you are using installshield 11.5 and earlier, you can initialize any variables in an "onBegin" method. With installshield 12 and later, use MsiSetProperty and MsiGetProperty(hMSI, "MyVariable", szSupportDir, nLen) to set and fetch global variables because when a Basic MSI installation executes an InstallScript custom action, the compiled InstallScript is loaded before the action is called, and it is unloaded after the action completes

Damien
If you have multiple scripts in the install process, can each one have an onBegin? I tried putting them in the onBegin in the initial file to launch (I am using them in a Component one) but, I got the same errors basically. It seems they have to be in the script I need them in?
Corv1nus
Actually it worked now in OnBegin. I must have had it in there wrong. THANKS!
Corv1nus