Where to place RemoveExistingProducts in a major MSI upgrade

When Windows Installer performs a major upgrade, the position of the RemoveExistingProducts action determines when the uninstall of the old product is performed. Despite efficiency, two factors dominate the decision

  • What should happen if either the install or the uninstall fails?
  • Should the new product ‘see’ registry entries/files/etc from the existing product or should the new product install ‘start from scratch’?

The following table summarizes the four possible approaches.

Position Audit scripted? Which product remains if … Unchanged files are reinstalled?
uninstall fails? install fails?
Between InstallValidate and InstallInitializeRemove old, install new No Old Neither Yes
After InstallFinalizeInstall new, remove old No Both Old No
After InstallInitialize, before any script-generating actionsRemove old, install new Yes Old Old Yes
Between InstallExecute (or InstallExecuteAgain) and InstallFinalizeInstall new, remove old Yes Old Old No

3 Responses to “Where to place RemoveExistingProducts in a major MSI upgrade”

  1. 1 Michal P November 29, 2007 at 2:47 pm

    Thank you, that was really helpfull!

  2. 2 Tom May 4, 2009 at 2:43 pm

    Thank you very much.

  3. 3 elainejames June 2, 2009 at 6:12 pm

    Good one.. thnx.. :)

Comments are currently closed.


About me

Johannes Passing, M.Sc., living in Berlin, Germany.

Besides his consulting work, Johannes mainly focusses on Win32, COM, and NT kernel mode development, along with Java and .Net. He also is the author of cfix, a C/C++ unit testing framework for Win32 and NT kernel mode, Visual Assert, a Visual Studio Unit Testing-AddIn, and NTrace, a dynamic function boundary tracing toolkit for Windows NT/x86 kernel/user mode code.

Contact Johannes: jpassing (at) acm org

Johannes' GPG fingerprint is BBB1 1769 B82D CD07 D90A 57E8 9FE1 D441 F7A0 1BB1.

LinkedIn Profile
Xing Profile
Github Profile

%d bloggers like this: