Umarlone
Posts: 20
Joined: Mon Oct 23, 2017 7:15 pm

Prevent customs actions running from previous version

Thu Mar 30, 2023 5:28 pm

I have having weird situation. While upgrading a version, say "1.0.0" to "2.0.0". I added completed new Customs for "2.0.0" with even different assembly name, all old methods have been removed in version "2.0.0". When I run installer for 2.0.0, the custom actions that were in 1.0.0 also run. why is that?
If the custom actions from previous versions will also run during upgrade, is there a way to prevent that somehow?

Thanks for the help.
Umar

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Prevent customs actions running from previous version

Fri Mar 31, 2023 1:19 pm

Hello Umar,

This may happen if in the old version you did not uncheck the "Uninstall" condition under the Execution Stage Condition section of your custom action.
uninstall conditions.png
uninstall conditions.png (47.38KiB)Viewed 3321 times

If you run the upgraded package on a machine which has the old package installed, the old package will be removed automatically (and silently) and the upgraded package will be installed.

Using the "Uninstall old version first and then install new version" option the installer removes the old applications entirely before installing the new application. Therefore, all custom actions (from the old version) that are scheduled to run during "uninstall" will be executed when the old version is removed.

Let me know if that helped.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Umarlone
Posts: 20
Joined: Mon Oct 23, 2017 7:15 pm

Re: Prevent customs actions running from previous version

Fri Mar 31, 2023 2:22 pm

Thanks for replying. The option you suggested is set but it still runs old custom action. Is there a way I can stop or remove something with new custom action it remove old custom actions before they run?
Attachments
Capture.PNG
Capture.PNG (25.55KiB)Viewed 3318 times

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Prevent customs actions running from previous version

Fri Mar 31, 2023 2:34 pm

Hello,
The option you suggested is set but it still runs old custom action.
This option will not prevent the custom action from the previous installation to run. If you already installed the old setup with the "Uninstall" execution stage option checked (see the above screenshot) for your custom action, there is nothing you can do from the new setup to prevent that custom to run when the old package is removed. This custom action is embedded in the old configuration and will be executed during uninstallation.

Please take a look at my colleague's reply on the "Error running installer after removing custom action" forum thread.

You need to recache the MSI or to use the Microsoft Fixit tool to remove the previous installation.

Hope this helps!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”