WiX - How to uninstall the bundle when uninstall the msi

我与影子孤独终老i 提交于 2019-12-01 19:40:00

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.

Well, you could use a custom action in the msi but don't.

You have inverted the designed relationship between bundles and packages. I suggest that you hide the package and show the bootstrapper in ARP.

The bootstrapper engine ("burn") is a package manager that collaborates with Windows Installer. Together they handle upgrades and uninstallation of packages. If, after understanding how it works, you don't want what it does then you may want a self-extractor instead of burn. (Some projects that do use burn are Visual Studio and WiX itself.)

Use -repair option when running the installer every time. It's a hack but it works. The problem is that the bundle uninstall is hidden, and when running uninstall you are only removing the package inside, not the bundle.

This causes the issue when you want to run the installation again after uninstalling the package inside. The installer thinks that the bundle is still installed. By using the -repair option (every time you install the bundle), you are telling it to either install the bundle if no bundle is present. or repair it if the package was removed.

-repair = repair (or install if not installed)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!