Leonardo Arruda
Leonardo Arruda

Reputation: 261

How to show messageBox with InstallShield 2009

I'd like to show a messageBox in the setup.

Have how to put this messageBox into a Custom Action? Because I want to this messageBox appears when one condition is satisfied.

If isn't clear, please, let me know!

EDIT:

I want to make a script to verify if the .exe that I'm trying to execute it's already installed, if don't --> execute, else --> do nothing.

Upvotes: 0

Views: 2946

Answers (2)

RBT
RBT

Reputation: 25945

My solution is w.r.t. Installshield 2014 but it is quite common use case to show an error message box during installation based on certain condition. So, this solution might help someone even in case you want to achieve it in an installshield version higher than Installshield 2009.

I achieved it through SpawnDialog control event as discussed below. Let's say you have a dialog with <Back, Next> and Cancel buttons. On the click of Next> button you want to make some check e.g. whether a service is up and running or not.

If service is down then you might want to show an error dialog popup instead of moving to the next wizard step. So this is how you setup your Next> button behavior as shown in the snapshot below:

enter image description here

Now you can notice the SpawnDialog event. I've set it to SetupErrorNew. What is SetupErrorNew? SetupErrorNew is also a dialog. I created it by cloning pre-existing SetupError dialog template as shown in the snapshot below:

enter image description here

This dialog will show the error message that you desire. Few key things that we need to set on the new error message dialog SetupErrorNew as below:

  1. Set the Error Dialog property of the dialog to False.
  2. Error dialog has a number of buttons for Yes, No, Ok, Cancel, Retry, Abort, Ignore options. Delete all buttons except Ok button.
  3. Set the appropriate error message text.
  4. Under Behavior -> For Ok button change the argument value of EndDialog event to Return as shown in the snapshot below:

enter image description here

Upvotes: 1

Adriano Repetti
Adriano Repetti

Reputation: 67118

Use an InstallScript function, there you have a MessageBox().

Upvotes: 0

Related Questions