upgradebootstrapperrepairwixsharp

Upgrade is not working at all, installing another version of application (Wixsharp, custom Bootstrapper)


I'm new to wix/wixsharp and bootstrapper. I created an installer and providing ProductID, UpgradeCode and version. Installer is working fine but when I'm creating new installer and giving different version it is simply allowing user to install the another version of application and bot can be seen in program files.

If I use the same file that was used earlier to install, it gives option to uninstall as expected but when I use the upgraded file it does not give upgrade or repair option.

Can anybody help me with this. Here is the code I'm using

project.UpgradeCode = new Guid("9fa9fcf6-e807-404d-a67a-d66f1a60ca53");
            project.ProductId = new Guid("0b2d7210-32ce-4095-9c46-aaccb1bf0733");
            project.Version= new Version("1.0.209.10040");
            project.MajorUpgrade = new MajorUpgrade
            {
                Schedule = UpgradeSchedule.afterInstallInitialize,
                DowngradeErrorMessage = "A later version of [ProductName] is already installed. Setup will now exit."
            };

In 2nd build I'm just changing Version("1.1.209.10040") keeping everything else same.

Please let me know if any other part of code is required as I'm really new I'm not sure I shared all the necessary information.


Solution

  • If you're trying to do a major upgrade you will need to change the ProductCode. Whenever you're building an upgrade you should refer to the Windows installer Upgrade page that MS publishes. I don't know if there is a specific one for WiX but the same concepts still apply.