31
Global options allow you to specify the location of an external tool. But what happens when you want to change that location at runtime, so for example you could specify a different version of the external tool. Some actions have options to do this, for example most compiler actions allow you to choose the compiler version. For those that don't, you can still modify a global option at runtime using some VBScript.

In this example (a real world example that came up on our news server recently), we want to modify the settings to control which version of InstallShield we are using.

-----------
Dim opt
Set opt = GetOptionsObject("InstallShield")
If not (opt is Nothing) then
   opt.CompilerLocation = "c:\version1\compiler.exe"
   opt.IFXLocation = "C:\version1\ifx.obl"
End If

The script editor has built in code completion, which makes it easy to find the correct parameter for the call to GetOptionsObject.

optionsname.png

You will also find that code completion is enabled for the options object that is returned from GetOptionsObject.

optionscc.png

One important thing to note about changing option's values at runtime, the changes are not persisted, so when you close the application, those changes are lost. This is intentional, so the default settings are preserved.

Post Rating

Comments

There are currently no comments, be the first to post one!

Post Comment

Only registered users may post comments.