WiX .NET Bootstrapper - Feature Selection

陌路散爱 提交于 2019-12-04 05:26:05

We solved this issue. There were a couple of key items missing.

1) In the Bundle that contains our application, the MSI Package was required the following attribute.

EnableFeatureSelection="yes"

2) In the managed bootstrapper application we were setting the install condition (state) to Absent for the feature we don't wish to install. The missing piece here was that all the items we do wish to install need to have Local set for their state as Unknown causes all items to be installed.

void CustomBA_PlanMsiFeature(object sender, PlanMsiFeatureEventArgs e)
{
   if (e.FeatureId == "FEATURE_TO_EXCLUDE")
       e.State = m_installFeature ? FeatureState.Local : FeatureState.Absent;
   else
       e.State = FeatureState.Local;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!