如何解决Wix Burn EnableFeatureSelection
我在2个MSI中拥有3个功能。
MSI 1
MSI 2
- 功能C
用户可以选择安装A,B,AB,ABC或C。
要将功能设置为可选功能,我已经设置了EnableFeatureSelection =“ yes”并将PlanMsiFeature设置为Local / Absent(取决于用户是否要包含它们)。
这适用于MSI 1中的2个功能,但不适用于MSI 2中的功能。
谢谢
绑定代码
<Chain>
<MsiPackage Id="1" Name="1.msi" SourceFile="1.msi" Vital="yes" Compressed="no" EnableFeatureSelection="yes"
displayName="1">
</MsiPackage>
<MsiPackage Id="2" Name="2.msi" SourceFile="2.msi" Vital="yes" Compressed="no" EnableFeatureSelection="yes"
displayName="2">
</MsiPackage>
</Chain>
BootstrapperApplication
PlanMsiFeature += SetupModel_PlanMsiFeature;
void SetupModel_PlanMsiFeature(object sender,PlanMsiFeatureEventArgs e)
{
switch (e.FeatureId)
{
case "FeatureA":
{
e.State = IncludeA ? FeatureState.Local : FeatureState.Absent;
return;
}
case "FeatureB":
{
e.State = IncludeB ? FeatureState.Local : FeatureState.Absent;
return;
}
case "FeatureC":
{
e.State = IncludeC ? FeatureState.Local : FeatureState.Absent;
return;
}
}
e.State = FeatureState.Local;
}
解决方法
这需要反复试验。主要是错误。
Wix似乎在MSI中至少需要1个功能,因此我向两个MSI添加了一个空功能。
<Feature Id="blankFeature">
<Feature>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。