Hi Alexander,
During an uninstallation of a package that is performed with the "msiexec /x {ProductCode}" command (as it happens when the "Uninstall a package with the same version (if found)" option is checked in the "Builds" page), the "AI_INSTALL_MODE" property is not set anymore, but instead, the "REMOVE" property is set to "ALL".
So, to make sure that your custom actions will be executed on uninstall, you need to use the "REMOVE="ALL"" condition too, as follows:
Code: Select all
(UILevel = 2 OR AI_INSTALL_MODE = "Remove" OR REMOVE = "ALL") AND WEBCONFIGEXISTS = "1"
Also, you need to move your first three custom actions from the "Install Execution Stage" section, after the "Searches" action group, otherwise the "WEBCONFIGEXISTS" property will never be set to "1" because, in your scripts, you set it based on some searches that had not been performed yet.
Best regards,
Eusebiu