2

I have an application whose installer can be delivered in two forms:

  1. An MSI package; and
  2. A WiX bundle containing the package along with some chained prerequisites.

Most users will opt to install the bundle, but I want to retain the possibility of manually installing the prerequisites and the MSI package.

My automatic update process involves downloading a new MSI package and doing a major upgrade. This works perfectly as long as the application was originally installed using the MSI package. However, if the application was installed from the bundle I end up with two versions installed side by side.

How can I make sure that an upgrade using a downloaded MSI correctly replaces or removes the original bundle?


Bundle.wxs:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <Bundle Name="The Product" Version="!(bind.packageVersion.TheProduct.Msi)" Manufacturer="TheCompany" UpgradeCode="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
      <bal:WixStandardBootstrapperApplication
          LicenseFile="Resources\license.rtf"
          LogoFile="Resources\logo.png" />
    </BootstrapperApplicationRef>

    <Chain>
      <PackageGroupRef Id="NetFx451Web" />
      <MsiPackage Id="TheProduct.Msi" SourceFile="$(var.TheProduct.Msi.TargetPath)" Vital="yes" Compressed="yes" />
    </Chain>
  </Bundle>
</Wix>

Product.wxs (the MSI):

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="TheProduct" Language="1033" Version="!(bind.fileVersion.TheProduct.dll)" Manufacturer="TheCompany" UpgradeCode="yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes" />
    <UIRef Id="WixUI_Minimal" />
  </Product>
    <!-- ... snip ... -->
</Wix>

1 Answer 1

1

An .msi package cannot upgrade a bundle; only another bundle can do that. But an .msi package can upgrade an .msi package that was originally installed by a bundle. You're getting two entries in ARP, not two packages installed side-by-side. @Ravi's answer is correct: Use ARPSYSTEMCOMPONENT to ensure that the .msi package isn't visible, to match how the bundle installs it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.