2
我们使用Wix创建我们的安装程序。我们正在使用用户界面来选择需要安装的功能。某些功能默认启用,其他功能被禁用。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>