zangw
zangw

Reputation: 48476

Installshield: how to add a message box in multiple instances selection dialog?

I use Basic MSI project to support multiple instance, and the max instance number is 16.

Here is the requirement, when the 6th instance is installed, the multiple instances selection dialog is shown as below,

enter image description here

I want to prompt one new message box when click the "next" button, how to do it? I can't find this dialog resource in project.

Upvotes: 1

Views: 845

Answers (1)

Michael Urman
Michael Urman

Reputation: 15905

InstallShield doesn't offer a way to do this directly. This dialog is shown by setup.exe before it launches the MSI, as once the Windows Installer is invoked, it's locked into that specific instance. Depending on the message box you want to show, you may be able to make it part of the MSI and show it early in the correct situations. However this isn't trivial to get correct.

The simplest approach would be to reference the InstanceId property, as this indicates which instance you are on. However after installing and uninstalling a few instances, the next one you install may not reflect the number currently on the system.

To be fully correct, you would have to have similar knowledge about the other instances to what setup.exe knows: it maintains a list of instances with their product codes (and more) so it can detect whether they are installed. If your MSI has this information, it can also detect other MSIs (perhaps via Major Upgrade entries set to detect-only, referencing the various UpgradeCode values of your other instances).

In either case, once you've identified your approximate or exact count, you can craft your message, and either show it on a dialog (say by putting it in a property that's shown in a label), or show it with a call to MsiProcessMessage.

Upvotes: 1

Related Questions