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
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)
Please log in to answer
Posted by:
wiseapp
20 years ago
Posted by:
gvlaarho
20 years ago
Posted by:
ewall
20 years ago
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:
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:
Hope that helps...
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.
so that the conversation will remain readable.