我们使用Wix来创建我们的安装程序。我们使用UI,用户可以在其中选择需要安装的功能。默认情况下,某些功能处于启用状态,而其他功能处于禁用状态。
但是,当我们运行升级时,这些默认值将被保留。我们希望安装程序记住安装了哪些功能,并在功能树中启用它们以进行升级。应禁用所有其他功能。
我们有这样的代码,它看起来可以工作,但实际上,它不是:
<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>发布于 2010-02-25 18:00:11
啊,看来我找错地方了。UpdgradeVersion标记上有一个名为'MigrateFeatures‘的属性,用于指定以下内容:
<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
复制相似问题