Search code examples
c#visual-studioinstallshield

How to abort a install shield installation from Visual studio?


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#?


Solution

  • 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.