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.
Which product remains if … | ||||
---|---|---|---|---|
Position | Audit scripted? | 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 |
Any opinions expressed on this blog are Johannes' own. Refer to the respective vendor’s product documentation for authoritative information.
« Back to home