Search code examples
installshieldinstallscript-msi

How can I tell (programmatically) when an Installshield installer is running silently?


I have a history of Installscript MSI installers (that have been replaced by Basic MSI installers), and when I uninstall them I need to know if the uninstall is being run silently or not. I run some custom code that checks for the existence of .iss files (necessary for silent uninstalls) and if they're not there I pop up a message saying that the files aren't where they're expected to be. The problem is that when the program is uninstalled from the Control Panel (not silently) this code runs and displays the message. So I need a system variable that will tell me it's running in silent mode so when it's not I can suppress the message.

I can't find anything that tells me this. Does anyone know of a way I can tell programmatically?


Solution

  • Assuming you want to detect a silent install from within the install, the answer depends on the project type:

    • InstallScript projects can check whether they're running silently by comparing the MODE system variable to SILENTMODE
    • Basic MSIs can compare the UILevel property to 2
    • InstallScript MSIs can check whichever is more relevant for the context (using MsiGetProperty to retrieve UILevel, if necessary, but watch out in deferred custom actions; they'll need to pass it through CustomActionData).
    • For completeness, but unlikely to be relevant for your question, Suites can reference the ISSilentInstall property.