I have added a vbscript to be run as a custom action during installation.
The script runs fine on its own, but when run as part the of the setup, the
WScript object is always empty. According to the documentation, this object
cannot be instantiated(created) deliberately and is supposed to be always
avaiable.
Has anyone else run into this? Does anyone know of a solution?
Wally
Hi Wally,
Thanks for posting. The Windows Installer Platform SDK explains the issue
as below:
"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."
As a result, we may use the following to access WScript.Shell:
Dim wshell
Set wshell = CreateObject("WScript.Shell")
I hope this helps.
Regards,
Felix Wang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
waldyn.benbenek@unisys.com - 20 Nov 2003 19:25 GMT
Thanks for your response. So how, then, does one pass data to the script?
There is a field to pass data in the project. How does the script pick it
up?
> Hi Wally,
>
[quoted text clipped - 25 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
Felix Wang - 21 Nov 2003 01:45 GMT
Hi Wally,
Thanks for the quick response.
If we author the MSI with VS.Net, to access the CustomActionData in a VBS
custom action, we can use the following:
Dim CAD
CAD = Property("CustomActionData")
MsgBox(CAD)
The string CAD will contain the CustomActionData input.
If you have any further cocerns regarding this issue, please feel free to
post here.
Regards,
Felix Wang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.