Thursday, April 05, 2007

VB Script and Wscript

MSI doesn't use the WScript object; Create the script with plain CreateObject instead of WScript.CreateObject.

Eg. if you have a script

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


which works OK as a standalone .vbs file, but terminates the install when used as a custom action

Replace it with

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


Never / Do not use Vbscript as Custom Actions.

  • Robust code is difficult write in script.
  • Debugging script in the Windows Installer is difficult.
  • Anti-virus products kill them.

More Info

Link 1; Link 2