2

I'm using wix Bundle to install chain of Msi's , When i'm trying to upgrade the older version is not uninstalling

please help me on doing below any of the scenarios

  1. How can i uninstall the previous version before install the latest version
  2. Always upgrade to the latest version, In My case it can be major release or minor release or patch release
  • If you implement windows installer major upgrades in the bundled msi you don't have to uninstall before installing a newer version. Also of note, the wix bootstrapper will properly upgrade versions that only differ in the 4th portion of bundle version. For a wix bundle to upgrade properly their versions must be different and they must share the same UpgradeCode – Brian Sutherland Apr 19 '16 at 20:00

2 Answers2

2

There's more to it then just uninstalling. First of all let's take a look at your versioning. The bundle itself has version and each of msis has its own version. I hope that when there's time for upgrade you have to upgrade the entire bundle without checking each of the packages separately, it might make it a bit easier. So now, each of MSIs should have Product > Upgrade attribute set and have Upgrade node. The values should be the same. Bundle should have attribute UpgradeCode. This should be enough for you to uninstall the previous version and install a new one.

Now, if you want to show something in the UI, you can go to your bootstrapper application and subscribe to all kinds of Detect events. There are some related to upgrade.

Here's the MSI that support update:

<Product Id="*" Name="$(var.ProductName)" Language="1033" Version="1.0.0.5" Manufacturer="$(var.Manufacturer)" Upgrade="GUID_HERE">
<Package InstallerVersion="450" Compressed="yes" InstallScope="perMachine" />
<Upgrade Id="SAME_GUID_HERE"/>

And burn:

<Bundle Name="$(var.ProductName)"
   Version="1.0.0.5"
   Manufacturer="$(var.Manufacturer)"
   UpgradeCode="ANOTHER_GUID"

So once you install packages with GUIDs inside, the next version will detect (using GUID) that product is installed already and will do an upgrade.

Andrey Marchuk
  • 13,301
  • 2
  • 36
  • 52
  • Thanks you, I'm using same version for bundle as well as for the msi's too. Not a problem i can change my code to check only bundle version. I don't want to show anything on the UI, user will click just install so that bundle has to upgrade by removing the old version. Can you provide me sample code for msi's and burn ? – Aravind Koniki Apr 19 '16 at 09:50
  • Thanks Andrey, I can check and let you know Can you clarify one thing, do i need to add major upgrade element in msi also? – Aravind Koniki Apr 19 '16 at 10:21
  • I have it in my code, but I have never seen the message, so you can add it as well – Andrey Marchuk Apr 19 '16 at 10:43
  • If you want the MSI to upgrade automatically you must define the element or an element in the wix XML. The element is a sneaky way of implementing the tag automatically referencing the the product's Upgrade GUID and filling in some additional information. I prefer to use the element as opposed to the element. – Brian Sutherland Apr 19 '16 at 19:57
  • I was working with major element, but it was not upgrading, Can you let me know how to do with major element, it would be great if you provide me the sample code – Aravind Koniki Apr 20 '16 at 05:46
  • You need to post some logs. It's relatively simple. Create installers with version 1 with samples from answer. Create version 2 with same guids and it's done. – Andrey Marchuk Apr 20 '16 at 06:18
0

In this way I was able to block the appearance of multiple bootstrapper windows. Eventually, no programs appears and we only see Msi. https://stackoverflow.com/a/62262418/12267227

Silny ToJa
  • 1,815
  • 1
  • 6
  • 20