Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX - How to uninstall the bundle when uninstall the msi

Im using WiX to install my .msi, I´m generating a WiX Bundle using the Bundle Element. I try to not show the Bundle on "Add/Remove programs" so i set the properties of the Bundle element like this:

<Bundle Name="$(var.ProductName)" Version="!(bind.packageVersion.MSIPackage)" 
      Manufacturer="$(var.ProductManufacturer)" UpgradeCode="$(var.UpgradeCode)" 
      DisableRemove="yes" DisableModify="yes" DisableRepair="yes">

DisableRemove, DisableModify and DisableRepair to "yes" made the Bundle be hidden under "Add/Remove programs".

My problem is that when i Uninstall my application, the application is uninstalled correctly but the Bundle remains Hidden, so it cause some problems when i try to install other version of the App, for example the new Bundle detects that there are other Bundle installed and performs some versioning check and so on.

So my question is: is possible to when the application in uninstalled from the "Add/Remove programs" uninstall the Hidden Bundle as well?

like image 662
Diego Avatar asked Dec 26 '22 14:12

Diego


1 Answers

To expand on Tom's answer, if you remove the Disables from your Bundle tag

<Bundle Name="$(var.ProductName)" Version="!(bind.packageVersion.MSIPackage)"
        Manufacturer="$(var.ProductManufacturer)" UpgradeCode="$(var.UpgradeCode)">

You can modify your MsiPackage tag to hide the MSI from Add/Remove Programs

  <MsiPackage
      Id="YOUR-ID"
      Vital="yes"
      DisplayName="$(var.ProductName)"
      SourceFile="$(var.Source.TargetPath)">

    <MsiProperty Name="ARPSYSTEMCOMPONENT" Value="1"/>

  </MsiPackage>

This will leave just one entry in Add/Remove Programs. Your Bundle will now handle the UI of the install and uninstall, and will correctly allow other versions of the bundle to be installed.

like image 189
levarius Avatar answered Jan 15 '23 06:01

levarius