Wix upgrade: preselect features

こ雲淡風輕ζ 提交于 2019-12-10 11:17:58

问题


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>

回答1:


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>


来源:https://stackoverflow.com/questions/2327513/wix-upgrade-preselect-features

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