0

I have one condition , if it true MSi installation/Uninstallation should terminate. How can i implement through vbscript in custom action. ?

anybody assist me.

Vijay
  • 3
  • 6
  • You don't need script to do that. Use whatever tool you are using to create a type 19 custom action and terminate the install with the message specified there when your condition is set. – PhilDW Oct 08 '14 at 16:04

1 Answers1

1

Return Values of JScript and VBScript Custom Actions

msiDoActionStatusNoAction 0 Action not executed.

msiDoActionStatusSuccess IDOK = 1 Action completed successfully.

msiDoActionStatusUserExit IDCANCEL = 2 Premature termination by user.

msiDoActionStatusFailure IDABORT = 3 Unrecoverable error. Returned if there is an error during parsing or execution of the JScript or VBScript.

msiDoActionStatusSuspend IDRETRY = 4 Suspended sequence to be resumed later.

msiDoActionStatusFinished IDIGNORE = 5 Skip remaining actions. Not an error.

Function MyVBScriptCA()

    If Session.Property("CustomErrorStatus") <> "0" Then
        'return error
        MyVBScriptCA = 3
        Exit Function
    End If

    ' return success
    MyVBScriptCA = 1
    Exit Function

End Function

Also consider reading VBScript (and Jscript) MSI CustomActions suck.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100