Hi,

I am looking something to replace in a vbscript put in a custom action from installation the "WScript.Quit"; it cause one error because all the wscript.xxxxxx seems to be understand by wise.
thanks
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Hi,

Could you paste the script that you using in the custom action and causing error. So that I can look for an exact issue.
Answered 08/15/2004 by: wiseapp
Second Degree Green Belt

Please log in to comment
0
Hello,

There is no general code, but this is an example

If condition = false then
WSCRIPT.QUIT
else
....
end if

also the same for wscript.sleep

Voilà ...

Gérard
Answered 08/18/2004 by: gvlaarho
Senior Yellow Belt

Please log in to comment
0
The issue is that when running a VBScript embedded inside Windows Installer, you're not running it from the Windows Scripting Host engine, so the WScript.* objects are not available.

There are two solutions:

1.) Don't use WScript objects.

In this case, you could wrap the entire script in a 'Main' subroutine, and do an "Exit Sub" when you want to quit, like so:


'start program
Main

'when Main subroutine ends, so does the script

Sub Main
'all your code goes here
If SOMETHING_IS_WRONG Then
Exit Sub
End If
End Sub

'end of the file


2.) If you need to use WScript objects, run the script from an installed file and create a custom action with a command line using the WSH interpretter like this:


[SystemFolder]wscript.exe //B "[scriptname.vbs]"


Hope that helps...
Answered 08/18/2004 by: ewall
Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity