Upgrade through Managed BA keeps the older version entry in ARP

Dec 10, 2015 at 9:42 AM
Hello,

I have created two BAs for two different versions of the product. When I upgrade the older version using BA, it keeps the older version's entry in ARP. But if same steps are performed using only .msis which are bundled in BAs, this issue doesn't occur.

Thanks,
Aakash
Coordinator
Dec 11, 2015 at 12:48 AM
Try to increment Bundle.Version.
Dec 11, 2015 at 4:20 AM
Hello Oleg,

That I am already doing. Please look at the upgrade bundle code -
    class Program
    {
        static void Main()
        {
            string productMsi = BuildMsi();

            var bootstrapper =
              new Bundle("MyProduct_1",
                  new PackageGroupRef("NetFx40Web"),
                  new MsiPackage(productMsi) { DisplayInternalUI = true });
            
            bootstrapper.Version = new Version("1.1.0.0");
            bootstrapper.UpgradeCode = new Guid("6f330b47-2577-43ad-9095-1861bb25844b");
            bootstrapper.Application = new SilentBootstrapperApplication();
            bootstrapper.PreserveTempFiles = true;
            bootstrapper.Build("MyProduct.exe");
        }

        static string BuildMsi()
        {
            var project = new Project("MyProduct_1",
                             new Dir(@"%ProgramFiles%\My Company\My Product",
                                 new File("Program.cs")));

            project.GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25889a");
            project.UpgradeCode = new Guid("6f330b47-2577-43ad-9095-1861bb25844b");
            project.Version = new Version("1.1.0.0");

            project.MajorUpgrade = new MajorUpgrade()
            {
                AllowDowngrades = false,
                DowngradeErrorMessage = "Lower version",
                AllowSameVersionUpgrades = false,
                Schedule = UpgradeSchedule.afterInstallValidate
            };

            return project.BuildMsi();
        }
    }
The version of older bundle and msi is 1.0.0.0 and the MSI's project.GUID is different for both versions. I've kept the UpgradeCode same.
Coordinator
Dec 11, 2015 at 9:00 AM
Hi Aakash,

It's hard for me to see what is wrong with your sample. Nothing that I can peek.

Though I just coded the "BA upgrading" sample. The testing showed that it behaves as it should. The sample is committed and you can use it as a bench mark:
https://wixsharp.codeplex.com/SourceControl/latest#src/WixSharp.Samples/Wix# Samples/Bootstrapper/WixBootstrapper/setup_upgrade.cs

Most likely there will be some little thing that makes your sample behave differently.

Cheers,
Oleg