Abort a Basic MSI installation from a Powershell custom action
This may sound simple but can someone give me a clue on how to abort an installation from a Powershell custom action?
I am using Invoke-SqlCmd to run some SQL statement in try...catch blocks but if it fails the custom action continues.
Return processing is set to "Synchronous (Check exit code)".
Thank you in advance.
Basic MSI projects have built in functionality to abort the installation if there are any SQL script handling errors.
See the screenshot below - clicking on the "Custom" button provides the "Custom error handling" dialog which allows you to enter specific error codes and designate the installer behaviour.