0

We have been working on rebuilding our installer with WIX and Burn, using a custom bootstrapper application. We are using a feature tree in our main MSI, and have set EnableFeatureSelection="yes" so that we can replicate the feature tree in our custom BA UI and send those feature selections down to the MSI at plan/apply time. This has all been working well until we started recently to test the upgrade process. We have run into what appears to be an open bug in Burn:

http://wixtoolset.org/issues/4616/

When we do a minor upgrade, the features that are already installed do not get upgraded...the originally installed code remains on the machine. From the testing and investigation we've done, we believe it's because Burn isn't passing REINSTALL="ALL" to the MSI package (which is what the above bug says).

We found this question where Rob says you have to handle the OnPlanMsiFeature() callback, which we are doing correctly.

wix pass option to msi for repair

Since the above bug has been open since Dec 2014, we didn't have confidence that it would be fixed soon, so we decided that we would try to find a workaround. What we've come up with so far is hackish at best, but at a proof of concept level, it shows some promise. We are copying the entire MsiPackage node, giving the copy a new ID and adding a property with REINSTALL=ALL on it, like this:

  <MsiPackage  Id="MSI"
    Cache="yes"
    Compressed="no"
    DisplayInternalUI="no"
    Vital="yes"
    Visible="yes"
    EnableFeatureSelection="yes"
    SourceFile="<path to MSI>">
  </MsiPackage>


  <MsiPackage  Id="MSI_REINSTALL"
    Cache="yes"
    Compressed="no"
    DisplayInternalUI="no"
    Vital="yes"
    Visible="yes"
    EnableFeatureSelection="yes"
    SourceFile="<path to MSI>">

    <MsiProperty Name="REINSTALL" Value="ALL"/>
  </MsiPackage>

Then, in our custom BA, we are using the DetectRelatedMsiPackage event to detect a minor upgrade. And using that minor upgrade detection to set the RequestState for each MsiPackage to either Local or None inside our PlanPackageBegin event handler, like this:

            if (e.PackageId == "MSI")
            {
                if (Operation == RelatedOperation.MinorUpdate)
                {
                    e.State = RequestState.None;
                }
                else
                {
                    e.State = RequestState.Present;
                }
            }

            if (e.PackageId == "MSI_REINSTALL")
            {
                if (Operation == RelatedOperation.MinorUpdate)
                {
                    e.State = RequestState.Present;
                }
                else
                {
                    e.State = RequestState.None;
                }
            }

We're hoping to have some guidance from others who have run into this error with upgrades in Burn with EnableFeatureSelection turned on. Will our workaround do the job? Alternatively, is there a way to dynamically create an MsiProperty from the custom BA so we can create REINSTALL=ALL as needed? Does anyone have other ideas of how to workaround this issue that are cleaner and/or more reliable?

If you need more information, let me know. We've been working with Wix/Burn for a couple months now, so we know some things...but we're not experts yet.

Community
  • 1
  • 1
Doug
  • 1
  • 3
  • The difficulty here is that a minor update is strictly an update to the existing installed files with REINSTALLMODE=vomus REINSTALL=ALL, subject to variations in REINSTALLMODE, and showing feature selection during this type of update is something that I'm very dubious about. I suspect MSI cannot simultaneously add and remove features while updating files. I believe you should be looking at a major upgrade - that's the normal and easy way to install an upgraded product and show a feature tree. – PhilDW Sep 23 '15 at 17:28
  • @PhilDW, you are correct based on what we've seen...you cannot change the features you have selected in a minor update. But we're not trying to. We just want the features that were already installed previously to get updated to new versions, and that's not happening. When we look in the burn logs, we do NOT get REINSTALL=ALL when it calls the MSI. And no updates happen on previously installed components...they still have the original versions. The fundamental issue seems to be that **EnableFeatureSelection** breaks the minor update process...and we're trying to find a good workaround. – Doug Sep 23 '15 at 19:07

2 Answers2

0

If you set EnableFeatureSelection="no" the minor upgrades works as expected. Maybe it is possible to add "ADDLOCAL" as MSIProperty for the feature you want to be updated like in https://stackoverflow.com/a/9679734/5698530 if you have EnableFeatureSelection="no". Also this post helped me https://stackoverflow.com/a/15394954/5698530.

Community
  • 1
  • 1
Gclpixel
  • 331
  • 3
  • 4
  • Thanks for posting an answer, but this won't work for our situation. Since we want the user to be able to select what features are installed, we can't do anything static in the XML...it has to be controlled through code. We've been using the "dual MSI" solution I described in the original question for a few months now, and once we worked out the kinks, it's working reliably. I'll go write that up as an answer and mark it...I should have done that awhile ago. – Doug Dec 22 '15 at 15:20
0

We've been running the "dual MSI" solution described in my original question for a few months now, and it's working reliably. If the open bug ever gets fixed, then we can change our approach. Also, if anyone has a better answer, please let me know. Until then, I'll mark this as answered.

Doug
  • 1
  • 3