I have a Wix installer that installs 2 MSIs with a custom UI.
I have 3 Features across 2 MSIs.
MSI 1
- Feature A
- Feature B
MSI 2
- Feature C
Users have the option to install A,B,AB,ABC or C.
To set the features as optional I have set the EnableFeatureSelection="yes" and set the PlanMsiFeature to Local/Absent depending on if the user wants to include them.
This is working for the 2 features in MSI 1, but not MSI 2. What am I missing?
Thanks
Bundle Code
<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;
}