/build/static/layout/Breadcrumb_cap_w.png

WScript.Quit

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

Answers (3)

Posted by: wiseapp 19 years ago
Second Degree Green Belt
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.
Posted by: gvlaarho 19 years ago
Senior Yellow Belt
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
Posted by: ewall 19 years ago
Purple Belt
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...
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ