WiX - How to remove a package when uninstalling msi

I use WiX to install my .msi, I create a WiX Bundle using the Bundle element. I try not to show the Bundle in "Add / Remove programs", so I set the properties of the Bundle element as follows:

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

DisableRemove, DisableModify and DisableRepair for "yes" launched the Bundle in the "Add or Remove Programs" section.

My problem is that when I uninstall my application, the application uninstalls correctly, but the bundle remains hidden, so it causes some problems when trying to install another version of the application, for example, the new bundle detects that there are other bundles installed and performs some version checking and etc.

So my question is: is it possible, when an application removed from "Add or Remove Programs" also removes the Hidden Package?

+4
source share
3 answers

To expand Tom's answer if you remove "Disable" from the Bundle tag

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

You can change your MsiPackage tag to hide MSI from Add or Remove Programs.

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

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

  </MsiPackage>

In "Add or Remove Programs" there will be only one entry. Your Bundle will now process the install and uninstall user interface and will correctly allow the installation of other versions of the package.

+6
source

Well, you can use custom action in msi, but not necessary.

. ARP.

bootstrapper ( "burn" ) - , Windows. . , , , , . ( , , - Visual Studio WiX.)

+4

-repair . , . , , , .

This causes a problem when you want to restart the installation after removing the package inside. The installer believes that the package is still installed. Using the -repair option (every time you install the package), you tell it to install the package if the package is missing. or repair it if the package has been removed.

-repair = restore (or install if not installed)

0
source

Source: https://habr.com/ru/post/1524108/


All Articles