0
votes

Do you think of any reason that this line should crash: Set oShell = WScript.CreateObject ("WScript.Shell")

... only if I launch the script from InstallShieldExpress as a custom-action.

MsgBox "before create ObjectShell"
Set oShell = WScript.CreateObject ("WScript.Shell")
MsgBox "after create ObjectShell"

I never see the "after create ObjectShell" message ;-(

and if I simply launch the script by double-clicking on the script file in a windows explorer, of course everything is ok.

1

1 Answers

2
votes

It may be that the global WScript object isn't available in the InstallShield environment. You can check this using a script like this:

MsgBox Not IsEmpty(WScript) ' True if WScript is defined, False if it's undefined

If WScript is undefined, try using CreateObject("WScript.Shell") instead. See also What is the difference between CreateObject and Wscript.CreateObject?