How to upgrade an older version of the package

As you build new versions of an installation package by using one tool or another, the new versions should be able to upgrade the older versions (remove them before the installation). Depending on the old package, there are three possible scenarios for upgrading it:

The old package is created with Advanced Installer

In this case, you can follow the steps explained in the Upgrades page. Note that you can choose between the "Automatically upgrade older product versions" and "Allow side by side installs of different product versions" options.

The old package is created with another tool and it is MSI-based

Since the old package is MSI-based, it most likely has an Upgrade Code. This code can be used in the "Upgrades" page in order to set the new package to upgrade the old one. With this method the old package is uninstalled automatically and silently right before the new installation starts.

NoteYou can add the "Upgrade Code" of the old MSI in the "Upgrades" page by using the [ New... ] button and selecting the old MSI file.

Another method is to use a custom action like explained in the Uninstall another MSI when my product is uninstalled How-To. In this case the custom action will not prompt the user (it will still be executed after "Install Execution Stage" -> "Finish Execution" -> "InstallFinalize")

The old package is created with another tool and it is not MSI-based

When you need to upgrade an installation package which is not MSI-based you can use a custom action. If the old package has an Uninstaller, you can use that as a target for the custom action. Since the old product should be removed before the new installation takes place, the custom action can use the condition NOT Installed and be scheduled straight under the "Preparing" action group.

NoteYou can see a standard action by using the "Show standard action" button on the "Custom Actions" page's toolbar.

You can still create an uninstall mechanism (e.g. uninstall script) and use a custom action, even if the old package doesn't come with its own Uninstaller. However, when you create the uninstall script you need to take into consideration that the custom action must remove all the resources (files, registry entries etc.) created by the old installation. The logic is still the same, the only difference being the custom action points now to the uninstall script you created rather than the vendor uninstaller.