The Not Installed
condition attempts to ensure that even if WIXUI_EXITDIALOGOPTIONALCHECKBOX
is set to 1 by default, the action is only published in scenarios that the exe is strongly likely to be present. Why do this? If someone selects to launch the exe when it's not present, an error message, or a missing UI, could confuse the user. In other parts of the installation process, a failed launch could abort and roll back the installer.
By then why is the condition NOT Installed
? That probably sounds backwards to you. But it's not an accident. The Installed
property is set at the launch of your installer, and is not updated until the next time it is launched. Even when the installer alters the state by installing or uninstalling the product, the value of Installed
is left untouched.
So what are the scenarios where NOT Installed
will be true on the ExitDialog?
First-time install:
Installed
will start (and remain) false, so at the end NOT Installed
will be true. If the installation completes successfully, your exe is probably there. If the installation is cancelled or rolls back, the installer could✱ show a different final dialog that does not offer the launch option.
Maintenance, repair, uninstallation: Installed
will start as true, so at completion NOT Installed
will be false. This can result in a false negative in, e.g., a repair scenario; the exe may be present but the installer will not try to launch it. But, more importantly, it prevents the attempt to launch the exe after it was just uninstalled.
Upgrades: Depending on the type of upgrade, this will be equivalent to one of the prior scenarios. Minor upgrades and small updates are a form of maintenance, whereas major upgrades act like a first-time install.
Note that this condition may not be foolproof in more complex projects. If your exe is installed only in a subset of your configurations (e.g., if it's installed only by a feature that you can choose to exclude, or by a component that depends on the version of the OS), you may want to enhance the condition or remove the launch action entirely.
✱ I say could show a different dialog because I'm uncertain what WixUI_Minimal does here. If it shows the same dialog, then the condition is insufficient to accomplish what I described here.