cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kyy8080
Level 3

Can't create object in custom acrion's script

Hi all,

i have a big problem. I have a script in custom action, but i can't run it. I get an error when i try to create an object for shell:

Set wshShell = WScript.CreateObject( "WScript.Shell" )

If i run that script alone, it works fine. What must i do to execute the script. I've call an install with administrator rights.

Thanks in advance
0 Kudos
(1) Reply
Lenwin
Level 10

Hi,

The installer runs script custom actions directly and does not use the Windows Script Host. The WScript object cannot be used inside a script custom action because this object is provided by the Windows Script Host. Objects in the Windows Script Host object model can only be used in custom actions if Windows Script Host is installed on the computer by creating new instances of the object, with a call to CreateObject, and providing the ProgId of the object (for example "WScript.Shell"). Depending on the type of script custom action, access to some objects and methods of the Windows Script Host object model may be denied for security reasons.

This is documented in the InstallShield Limited Edition help Library at section:

Windows Installer->Windows Installer Guide->Custom Actions->About Custom Actions->Scripts

Thanks,
Lenwin
0 Kudos