Question

I have two MSI's; framework.msi and product.msi. The framework.msi installs dll's into the GAC that the product.msi depends on for both install and uninstall.

I've created a BA that chains the two MSI's together.

<Bundle ...>
  <Chain>
    <PackageGroupRef Id='framework'/>
    <PackageGroupRef Id='product'/>
  </Chain>
</Bundle>
<Fragment>
  <PackageGroup Id="framework">
    <MsiPackage Name="Product Framework"
                ForcePerMachine="yes"
                SourceFile="framework.msi"
                Vital="yes"
                Cache="no"
                Permanent="no"
                Compressed="yes"
                Visible="yes"/>
  </PackageGroup>
  <PackageGroup Id="product">
    <MsiPackage Name="Product"
                ForcePerMachine="yes"
                SourceFile="product.msi"
                Vital="yes"
                Cache="no"
                Permanent="no"
                Compressed="yes"
                Visible="yes"/>
  </PackageGroup>
</Fragment>

For fresh installs, my framework.msi and product.msi install correctly. When I go to upgrade to a new version, it upgrades the framework.msi successfully. Then it proceeds to uninstall the product.msi but it fails (for this error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'CheckInstaller, Version=1.0.0.0' or one of its dependencies. The system cannot find the file specified.) because the uninstall CustomAction references a version of an assembly (CheckInstaller) that is no longer in the GAC (because it has been upgraded as part of the framework.msi upgrade).

Without having to write a custom BA, I want to be able to do something like this:

// pseudo code
if(product.Exists() && framework.Exists())
{
  product.Uninstall(); // product is dependent on the framework
  framework.Uninstall();
}
framework.Install();
product.Install();

I realize this would be possible if we were to combine the two MSI's into one big product but since we disperse the framework.msi to other teams and for various other reasons, they need to be kept separate.

Is what I want to do even possible to do with the WiX bootstrapper?

Was it helpful?

Solution

That isn't possible with Burn today. The chain is fixed. On install it runs through forward, on uninstall it runs through backwards. I can think of two options available today:

  1. Do not have the MSI's upgrade each other and let the old MSIs be removed when the new Bundle uninstalls the old Bundle.

  2. Avoid creating install time dependencies between packages. This generally is a good thing to do anyway.

A feature request might be to have the new Bundle have the ability to remove the old Bundle before installing instead of after like it is today, but that isn't supported at this point in time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top