1

I've upgraded an old Wix based installer that has both an MSI generating project and a bootstrapper project (in Visual Studio). The bootstrapper sequences the MSI with a check for .Net pre-requisite/download. The new Wix# project just produces an MSI and it is installing and working just fine other than I cannot get it to replace the older installs. I've set the new project UpgradeCode to match what I see in the old MSI project (and which is in the windows registry in the uninstall list). I see the UpgradeCode being generated into the WXF file. But when I couldn't get that to work I tried setting it to match the UpgradeCode from the self-installing bootstrapper (which is what the end user runs). That didn't help.

I've read about similar experiences here and here. I've also set the upgrade strategy a few different ways including:

            project.MajorUpgrade = MajorUpgrade.Default;

And:

            project.MajorUpgrade = new MajorUpgrade
            {
                Schedule = UpgradeSchedule.afterInstallInitialize,
                AllowDowngrades = true,
                IgnoreRemoveFailure = true,
                AllowSameVersionUpgrades = false
            };

And:

            project.MajorUpgradeStrategy = new MajorUpgradeStrategy
            {
                RemoveExistingProductAfter = Step.InstallInitialize,
                UpgradeVersions = new VersionRange
                {
                    Maximum = project.Version.ToString(),
                    IncludeMaximum = false,
                    MigrateFeatures = false
                },
                PreventDowngradingVersions = new VersionRange
                {
                    Minimum = project.Version.ToString(),
                    IncludeMinimum = false
                },
                NewerProductInstalledErrorMessage = "A newer version of [ProductName] is already installed. Setup will now exit."
            };

And various variations on those themes. Nothing I've done has impacted behavior, which is to say after installing, both the old and the new version of the application is listed in the add/remove Windows list. Is there some missing secret sauce to this migration path?

UPDATE:

I've realized my last snippet attempt there is actually working*. It's triggering the removal of everything except the entry in the Windows add/remove programs! Can this be due to a name change for the application in the new installer? Or maybe it's remaining around due to the old bootstrapper somehow, since I'm using the UpgradeCode from the old MSI and not doing anything specific with the bootstrapper?

UPDATE2:

The "old" installer has both an MSI and EXE (bootstrapper) version of the setup. If I just install using the old MSI, then run the new MSI, all works perfectly. So it seems that it is something related to running the bootstrapper EXE that is not getting removed.

DennisWelu
  • 788
  • 13
  • 26
  • 1
    [Common major upgrade problems](https://stackoverflow.com/questions/56989906/wix-does-not-uninstall-older-version/56991527#56991527). For the ARP issue, please try to close the ARP applet and maybe reboot and see if it is gone. Then test on a clean virtual machine to see if the upgrade scenario is working. Your developer machine could be in a dirty state. Most often developer machines end up like that - in the heat of the battle (just to state the obvious, for no obvious reason - it is a Vulcan thing) :-). – Stein Åsmul Jan 20 '20 at 14:54
  • That's a good thought, @SteinÅsmul, so I went through the motions. But alas it's there. And in fact it's "real" in the sense I can still tell it to uninstall and it jumps to the end of the uninstall quickly, then removes itself. I will check out the link also. – DennisWelu Jan 21 '20 at 02:23
  • 1
    Do you have a proper log created? [Please see here](https://stackoverflow.com/a/54458890/129130). Tips for interpreting the log can be found in that answer as well. Short version: search for ["value 3"](http://robmensching.com/blog/posts/2010/8/2/the-first-thing-i-do-with-an-msi-log/). – Stein Åsmul Jan 21 '20 at 02:34
  • Great tips. I tested creating a log and there were no "value 3"'s in it. I probably need to study it more but nothing jumped out as an error. I did add Update2 in my post above. – DennisWelu Jan 21 '20 at 04:28

0 Answers0