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

Custom Action Exit Codes

I am trying to properly terminate an MSI from installing,
if a custom action I wrote in VBScript fails. However,
even though I am passing back a exit code, the MSI keeps
going like nothing happened.

In my VBScript Custom Action I have the following
happening when there is a failure:

Set objRecord = Session.Installer.CreateRecord(0)

objRecord.StringData(0) = "The name of this computer, " &
objNet.ComputerName & ", is not registered to install Open
Session.Message msiMessageTypeError, objRecord
intExitCode = 1603

Isn't 1603 the exit code for ERROR_INSTALL_FAILURE - A
fatal error occurred during installation?

What am I doing wrong?


(1) Reply
For VBScript, you'll want to return the value 3 (constant name IDABORT) from your VBScript function to abort the installer; please see the MSI Help Library page "Return Values of JScript and VBScript Custom Actions".

If you have a copy of Administrator's Introduction to Application Repackaging and Software Deployment using Windows Installer (, this is described in Chapter 8, p. 216.