cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom Action shall stop installation

I use the following command in my CA to check the value of "a". If its >10 a message shall appear and the msi shall finish with rollback.

If a>10 Then
Msgbox "Installation stops now!"
WScript.Quit
End If

In fact the message "Installation stops now!" appears followed by an error-message and the installation stops.

How can I finish the installation correctly and get rid of the error-message?

The CA is written in vb-script, starts synchronous (check exit-code) and the Install-UI-Sequence is "After Setup CompleteSuccess".
(2) Replies
You're on the right track however WScript.Quit isn't exactly intepreted as an exit code. You'll need to something with a bit more finesse. Try this:


Function MyCustomAction

If a>10 Then
Msgbox "Installation stops now!"
'WScript.Quit
MyCustomAction=3
End If

' A return value of 1 is successful
MyCustomAction=1
End Function

You'll need to make sure to specify the function name is added to the definition of the custom action.

Hope that helps...
It works - thx!