Question

I'm trying to setup a simple application using InstallShield 2012 Spring, and in a certain point of installation I want to check the free disk space accourding to proceed or exit the setup.

So, my main doubt is how can i exit the installation according a returned value from a method in a DLL ?

I define a c# custom action to be executed "After File Transfer" but I dont know how to exit the setup

Was it helpful?

Solution

You have three options:

  • Return a return value known to MSI, assuming you're using InstallShield's Managed Code Custom Action and processing the return codes. (The most common codes there are 0 for success, 1602 for user cancel, and 1603 for failure.)
  • Throw an exception, same assumption, which will be treated as ERROR_INSTALL_FAILURE.
  • Set a property and use another custom action (such as a type 19 Error action) to exit the installation.

You can combine the first and third approaches to set properties that tweak the messages that will show on the end dialog corresponding to the return code you select. The dialog is chosen per the negative sequences of the InstallUISequence table (SetupCompleteSuccess, SetupCompleteError and such).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top