tags:

views:

135

answers:

1

Hi,

we're using Wix to create our installers. We're using the UI where one can select the features that need to be installed. Some features are enabled by default and others are disabled.

However, these defaults are retained when we run an upgrade. We would like the installer to remember what features were installed and enable them in the Feature Tree for upgrading. All other features should be disabled.

We had this code, which seemed to work, but actually, it didn't:

<Feature Id="MainFeature" Level="1" ConfigurableDirectory="INSTALLDIR" Display="expand">
    <Feature Id="Feature1" Level="1" InstallDefault="local" AllowAdvertise="no">
        <ComponentGroupRef Id="Feature1ComponentGroup" />
        <Condition Level="3">(PROJECTUPGRADE AND NOT !Feature1=2)</Condition>
    </Feature>            
    <Feature Id="Feature2" Level="3" InstallDefault="local" AllowAdvertise="no">
        <ComponentGroupRef Id="Feature2ComponentGroup" />
        <Condition Level="1">(PROJECTUPGRADE AND !Feature2=2)</Condition>
    </Feature>
</Feature>
A: 

Ah, it seems I was looking in the wrong place. There is an attribute called 'MigrateFeatures' on the UpdgradeVersion tag that specifies this:

<Upgrade Id="$(var.UpgradeCode)">
    <UpgradeVersion Minimum="$(var.ProductVersion)" IncludeMinimum="yes" OnlyDetect="yes" Property="PROJECTDOWNGRADE" />
    <UpgradeVersion Maximum="$(var.ProductVersion)" IncludeMaximum="no" Property="PROJECTUPGRADE" MigrateFeatures="yes" />
</Upgrade>
Lodewijk