set

InstallShield 2016 » InstallScript Language Reference

The set keyword must precede the assignment of an OBJECT variable to a reference returned by the CreateObject function. For example:

function OnBegin( )

    OBJECT oMSI;

begin

    // create the object

    set oMSI = CreateObject("WindowsInstaller.Installer");

 

    // use the object (display MSI version on user's system)

    MessageBox("Your MSI version is: " + oMSI.Version, INFORMATION);

 

    // free the object

    set oMSI = NOTHING;

end;

Note • You can use the keywords try–catch–endcatch for more control over exception handling for COM objects.