0

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

mmarques
  • 625
  • 3
  • 9
  • 27

1 Answers1

1

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

Michael Urman
  • 15,737
  • 2
  • 28
  • 44
  • Thanks. I'm using your first sugestion. But now my doubt is how to perform action accourding the return type. For example: if the return is ERROR_FUNCTION_NOT_CALLED i want to show a custom dialog. Can you give me an ideia to do this or some tutorial ? Thanks – mmarques Oct 23 '13 at 15:32
  • You can combine the above with the negative value sequences - see http://msdn.microsoft.com/en-us/library/windows/desktop/aa369500.aspx - and use properties tweak the message on the corresponding dialog that gets shown. Or you can show the message as part of your original custom action (easier, but worse experience). – Michael Urman Oct 24 '13 at 00:26