Home > Software design >  How to abort a install shield installation from Visual studio?
How to abort a install shield installation from Visual studio?

Time:09-29

I install a exe in visual studio which is a part of installshield project. I need to check the existence of a registry and based on the result, I have to abort the installation of entire Installer. Is there any way to trigger the abort process in C#?

CodePudding user response:

There is no need to write any code for this. This is already a supported feature of windows-installer.

In Installshield, go to behavior and logic > System Search. Define a new system search.

Choose the Registry entry item.

enter image description here

Select the registry path and value for which you want to search.

enter image description here

Create any custom property here and check the radio box to Store the value in property and use in Install condition.

enter image description here

This is it.

CodePudding user response:

You can just throw an exception. That will do.

throw new Exception("Whatever message you want in log");

Make sure to set return processing of the custom action to check exit code.

  • Related