Reputation: 357
I created a basic stand-alone msi file using InstallShield 2012. There is a prerequisite that needs to be fulfilled before installation begins. To check this prerequisite, I created an InstallScript-based custom action and added to the very first position in Sequences. If the check fails, the msi should display an error message and then quit. Because the msi will be run both directly via double-clicking and silently via msiexec, the error message should be smart enough to launch a message box during direct install (UI is available) and suppress any message box during silent install (I use "SpretfMsiLog" to write the error message into msi log file).
I tried to run silent install using "msiexec /qn" but the message box still showed up. Is there a way to detect the install mode from with InstallScript code and therefore hide/show the message box accordingly?
Upvotes: 0
Views: 3855
Reputation: 619
An alternative to checking UILevel, would be to check the mode.
if (MODE == SILENTMODE) then
...
endif;
Description: http://helpnet.installshield.com/installshield18helplib/mergedProjects/installshield18langref/LangrefMODE.htm
Upvotes: 0
Reputation: 15905
The proper approach for this involves using MsiProcessMessage to show the message, as it can parent the window correctly and already knows when not to show it at all. However if you're looking for the minimal changes to what you already have, it's possible that checking the UILevel property will be easier to implement.
Upvotes: 0