Antarctica
Posts: 110
Joined: Tue Jul 08, 2014 9:24 am

Installer does not execute Custom Action on Uninstall

I have to execute a custom action on uninstall, before the custom IIS application is removed:

Image

which relies on the execution of this custom action:

Image

which is executed before:

Image

However, the execution does not take place, and I don't see why.

On software updates, it is correctly executed, but not on uninstall.
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Installer does not execute Custom Action on Uninstall

Hi,

I'm not sure why that custom action is not executed. Can you send me your project a verbose log of the uninstall to support at advancedinstaller dot com, so I can investigate them?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Antarctica
Posts: 110
Joined: Tue Jul 08, 2014 9:24 am

Re: Installer does not execute Custom Action on Uninstall

Hello Eusebiu,

I finally found the time to come back to this issue. I did not find how to tell Advanced Installer to make me a verbose uninstall log. A relevant post I found does not tell me where to find that shortcut.

However, I have created a bare aip file for you, see attached. The installer you can build from it should exhibit the problem. Installation requires only IIS on the computer.

How to reproduce:
- During install, enter a text into the text box.
- Reinstall same version - the text won't show up the next time you execute the installer, you have to enter a new one.
- Create an update package (increase version number to e.g. 1.0.1, and generate new product code) and execute. It shows the text.

Kind regards,

Alexander
Attachments
IIS-Install.aip
(97.15 KiB) Downloaded 272 times
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Installer does not execute Custom Action on Uninstall

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
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Antarctica
Posts: 110
Joined: Tue Jul 08, 2014 9:24 am

Re: Installer does not execute Custom Action on Uninstall

Hello Eusebiu,

yes, you are right - one issue seems to be that some searches have to be executed before, and others can only be executed after the custom action has been executed.

Correct order:
- Registry Search for APPDIR
- CheckWebConfig CA
- DecryptAppSettings CA
- XML Search for TESTPROPERTY

But it seems I cannot use that order from AI interface, because all searches are executed directly after each other. So now I have to find how to achieve it nonetheless. Maybe I should move the read from the XML file into a custom action completely?

Kind regards,

Alexander
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Installer does not execute Custom Action on Uninstall

Hi Alexander,

The registry searches and the XML searches are executed by two different standard actions. So, in order to move the XML Searches after your custom actions, you can go in the "Table Editor" page, "InstallExecuteSequence" table and set the appropriate sequence value for the "AI_XmlLocator" action.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”