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

Execute Custom Action on uninstall

I want to execute two CustomActions during uninstall, before the IIS is reconfigured and the files are removed. I have checked "Uninstall if same version found".
When I uninstall, and also when I execute installer to reinstall same version, CustomAction is not executed in time.

I have added the CustomActions in TableEditor to the table "InstallExecuteSequence" with the condition "UILevel = 2" and Sequence "1003"/"1004", but I guess I have chosen the wrong table or too late sequence? Which one it is?
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Execute Custom Action on uninstall

Hi,

In order to add a custom action you can use the support from the "Custom Actions" page. Also, if you want to execute it only on uninstall, you can check only the "Uninstall" option for it. In your scenario, it is recommended to place it before the "Remove Resources" action group.

Please keep in mind that the "UILevel = 2" condition sets the custom action to be executed only on a silent uninstall and it will not be executed if the installation is done with UI.

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: Execute Custom Action on uninstall

Thanks for the reply. I cannot use the Custom Actions page because the same Custom Action is also executed in the Wizard Dialogs stage of the installation, and I seem unable to add it twice to the sequence.

I have checked the "Uninstall" dialog stage condition on the custom action executed in the Wizard Dialogs Stage, however, it is not executed on uninstall, presumably because there are no dialogs shown on uninstall.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Execute Custom Action on uninstall

Hi,

In order to add a custom action on Wizard Dialogs Stage and also on Install Execution Stage you just need to add it to one stage (e.g. Wizard), then right-click on it and select the "Sequence -> Install Execution" option.

If the package is uninstalled with Basic UI or in silent mode all the custom actions present on the Wizard Dialogs Stage will not be executed.

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

Return to “Common Problems”