Wix 升级:预选功能 [英] Wix upgrade: preselect features

查看:22
本文介绍了Wix 升级:预选功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用 Wix 来创建我们的安装程序.我们正在使用用户界面,您可以在其中选择需要安装的功能.默认情况下,某些功能处于启用状态,而其他功能处于禁用状态.

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>

推荐答案

啊,看来我找错地方了.UpdgradeVersion 标签上有一个名为MigrateFeatures"的属性,用于指定:

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>

这篇关于Wix 升级:预选功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆