Difference between "Replaced by a new version" and "Upgrade" execution stage conditions - Advanced Installer Community
Mariano
Posts: 2
Joined: Thu Jun 04, 2026 7:06 pm

Difference between "Replaced by a new version" and "Upgrade" execution stage conditions

Inside custom actions you can choose the stage condition, under install there is First time install and Upgrade, under uninstall there is regular uninstall and replaced by a new version.
Screenshot 2026-06-04 121736.png
Screenshot 2026-06-04 121736.png (8.22 KiB) Viewed 31493 times
I'm not understanding the difference between choosing Upgrade and Replaced by a new version.

This is what is on the user guide:
Upgrade - The custom action will execute during installation of the package only if an older version was found on the target computer.
Replaced by a new version - The custom action will execute during removal of the application trigerred by the installation of a new version. This option is available only during "Install Execution Stage".

I think they are the same? only that replaced by a new version can only be executed during install execution stage?

It is also mention that the custom action executes "during" installation and removal of the application, but isn't this controlled by where in the sequence you place the custom action?
Catalin
Posts: 7847
Joined: Wed Jun 13, 2018 7:49 am

Re: Difference between "Replaced by a new version" and "Upgrade" execution stage conditions

Hello Mariano and welcome to our forums,

The upgrade is a two steps process:

- the older version is uninstalled
- the newer version is installed

Now, regarding your question, it depends what you want your Custom Action to do.

For example, if you want it to do something during the old package uninstall, then "Replaced by a newer version" option is the desired one.

If you want to do something during the installation of the new package, then the "Upgrade" option should be chosen.

Let me know if you have any additional questions and I will gladly assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Mariano
Posts: 2
Joined: Thu Jun 04, 2026 7:06 pm

Re: Difference between "Replaced by a new version" and "Upgrade" execution stage conditions

So if I place my custom action after the 'install files' of the installation sequence, and I only select 'Replaced by a new version', will my custom action actually not run?
Catalin
Posts: 7847
Joined: Wed Jun 13, 2018 7:49 am

Re: Difference between "Replaced by a new version" and "Upgrade" execution stage conditions

Hello Mariano,
So if I place my custom action after the 'install files' of the installation sequence, and I only select 'Replaced by a new version', will my custom action actually not run?
The custom action will run. It will just run during the old package uninstall process, instead of the new package install process.

Could you please let me know what exactly you are trying to achieve here? Having more information will certainly help me in assisting you better. :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”