If you use InstallShield 11.5 and earlier, you can initialize any variables in the OnBegin method.
Using InstallShield 12 and later, use MsiSetProperty and MsiGetProperty(hMSI, "MyVariable", szSupportDir, nLen) to set and select global variables, because when the basic MSI installation performs a custom InstallScript action, the compiled InstallScript is loaded before the action is invoked and unloaded after completion of the action.
source share