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

Abort a Basic MSI installation from a Powershell custom action

Hi,

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.

Christophe

Labels (1)
0 Kudos
(2) Replies
shunt
Revenera Moderator Revenera Moderator
Revenera Moderator

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.

Capture.JPG

 

0 Kudos

Thanks shunt, but I handle my SQL transaction via a Powershell ps1 script instead of SQL scripts, therefore I was more looking at how to abort the installation from Powershell.

0 Kudos