How to uninstall previous Burn package when installing MSI

360 views Asked by At

Let's say that I have distributed a WiX Burn package with a certain upgrade code (I do not know any product codes). Let's say that I decide that moving forward, I want to move to an MSI package. The question is: how can I remove the previous Burn package given the upgrade code when I install the MSI package? I have given both the same Upgrade Code, but the MSI appears not to uninstall Burn by default.

1

There are 1 answers

0
jbudreau On BEST ANSWER

You'd likely need to write a custom action in your MSI that walked through all registry keys under:

HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall

and searched for a registry value "BundleUpgradeCode" with the value of your static UpgradeCode guid. When you find it, read in the value of the entry "UninstallString" or "QuietUninstallString". That's the command you'll need to execute in order to uninstall the previous bundle before installing your new MSI.

Caveat: there's no rollback support with this approach if you uninstall the old bundle and the new MSI installer fails. You'll end up with a machine that has neither of your products installed.