PDA

View Full Version : Use of WScript within VBScript



DavidRead
01-12-2007, 08:58 AM
Should it be possible to use WScript within a custom action VBScript?
I'm trying to do this:

Dim wshShell
Set wshShell = WScript.CreateObject("WScript.Shell")
Dim a
a = wshShell.Run("some.exe param", 1, true)
a = wshShell.Run("another.exe param", 1, true)

which works OK as a standalone .vbs file, but terminates the install when used as a custom action on 'After Setup Type Dialog'.
It terminates with the message 'The wizard was interrupted before MyApp could be completely installed' ...

It doesn't seem to matter where I put the custom action - i.e. attach it to a different dialog - same error.

RobertDickau
01-12-2007, 09:33 AM
MSI doesn't use the WScript object; perhaps try the script with plain CreateObject instead of WScript.CreateObject. (Or would a couple of launch-an-EXE actions do the trick instead?)

DavidRead
01-15-2007, 09:23 AM
Leaving out the WScript works just fine - I didn't know you could do that!
The reason for not using a couple of exes is that I'm actually doing more than that, but shortened it for the post.
Thanks for the help.