我们使用 Wix 来创建我们的安装程序。我们使用的用户界面可以选择需要安装的功能。某些功能默认启用,其他功能则禁用。
但是,当我们运行升级时,这些默认值将被保留。我们希望安装程序记住安装了哪些功能,并在功能树中启用它们以进行升级。应禁用所有其他功能。
我们有这段代码,它似乎有效,但实际上却无效:
<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>
啊,看来我找错地方了。有一个属性叫做“迁移功能 http://wix.sourceforge.net/manual-wix2/wix_xsd_upgradeversion.htm' 在 UpdgradeVersion 标记上指定:
<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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)