Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wix 为什么在使用FeatureGroupRef时不能从FeatureGroup中选择单个要素?_Wix_Wix3.8 - Fatal编程技术网

Wix 为什么在使用FeatureGroupRef时不能从FeatureGroup中选择单个要素?

Wix 为什么在使用FeatureGroupRef时不能从FeatureGroup中选择单个要素?,wix,wix3.8,Wix,Wix3.8,我在片段中有一个FeatureGroup,看起来像这样: <Fragment> <FeatureGroup Id="ConsolidatedFeatureCollection"> <ComponentGroupRef Id="ComponentCollection" /> <Feature Id="Feature1" Title="Feature1" Level="1" AllowAdvertise="no" > <Compo

我在片段中有一个FeatureGroup,看起来像这样:

<Fragment>
<FeatureGroup Id="ConsolidatedFeatureCollection">
  <ComponentGroupRef Id="ComponentCollection" />
  <Feature Id="Feature1" Title="Feature1" Level="1" AllowAdvertise="no" >
    <ComponentRef Id="Component1" />
  </Feature>
  <Feature Id="Feature2" Title="Feature2" Level="1" AllowAdvertise="no" >
    <ComponentRef Id="Component2" />
  </Feature>
  <Feature Id="Feature3" Title="Feature3" Level="1" AllowAdvertise="no" >
    <ComponentRef Id="Component3" />
  </Feature>
  <Feature Id="Feature4" Title="Feature4" Level="1" AllowAdvertise="no" >
    <ComponentRef Id="Component4" />
  </Feature>
</FeatureGroup>
<Feature Id="MainFeature" Title="Super Awesome Program"  Level="1" AllowAdvertise="no" InstallDefault="local" Display="expand">
  <FeatureRef Id="SomeOtherFeature"/>      
  <FeatureGroupRef Id="ConsolidatedFeatureCollection"/>
</Feature>
我从我的主要功能中引用了以下功能组:

<Fragment>
<FeatureGroup Id="ConsolidatedFeatureCollection">
  <ComponentGroupRef Id="ComponentCollection" />
  <Feature Id="Feature1" Title="Feature1" Level="1" AllowAdvertise="no" >
    <ComponentRef Id="Component1" />
  </Feature>
  <Feature Id="Feature2" Title="Feature2" Level="1" AllowAdvertise="no" >
    <ComponentRef Id="Component2" />
  </Feature>
  <Feature Id="Feature3" Title="Feature3" Level="1" AllowAdvertise="no" >
    <ComponentRef Id="Component3" />
  </Feature>
  <Feature Id="Feature4" Title="Feature4" Level="1" AllowAdvertise="no" >
    <ComponentRef Id="Component4" />
  </Feature>
</FeatureGroup>
<Feature Id="MainFeature" Title="Super Awesome Program"  Level="1" AllowAdvertise="no" InstallDefault="local" Display="expand">
  <FeatureRef Id="SomeOtherFeature"/>      
  <FeatureGroupRef Id="ConsolidatedFeatureCollection"/>
</Feature>
表示它将多个组件、功能和合并组合在一起,以便在其他位置使用。并且表示它用于创建对另一个片段中FeatureGroup的引用。这看起来很简单,所以我希望使用我上面提到的FeatureGroupRef将产生与使用FeatureRef为每个单独的功能完全相同的结果:

<Feature Id="MainFeature" Title="Super Awesome Program"  Level="1" AllowAdvertise="no" InstallDefault="local" Display="expand">
  <FeatureRef Id="SomeOtherFeature"/>      
  <FeatureRef Id="Feature1"/>   
  <FeatureRef Id="Feature2"/>   
  <FeatureRef Id="Feature3"/>   
  <FeatureRef Id="Feature4"/>   
</Feature>
事实上,这似乎正是FeatureGroup元素的目的。当我使用或引用FeaturesDlg时,情况并非如此。使用FeatureGroupRef,我无法安装单个功能。如果选择了组中的任何一项功能,则将安装所有功能。您在UI中从未看到任何这方面的指示,但它们已安装


我使用的是WIX工具集3.8 v3.8.1128.0的稳定版本,而且我对WIX还比较陌生,所以我不敢假设这么大的bug已经在社区中消失了几个月。我是否遗漏了功能组的工作方式?除了为每个功能选择FeatureRef外,是否还有其他方法可以选择单个功能?在现实生活中,有四个以上的项目,并且有几个项目将使用它们

我发现了问题所在。有点尴尬。ComponentCollection是包含Component1、Component2、Component3和Component4的ComponentGroup。我将其添加到FeatureGroup中,因为我认为我需要参考这些组件的来源。我实际做的是包括FeatureGroup中的所有组件。我的印象是FeatureGroup只包含功能,但显然,它可以独立于其功能安装自己的内容

一旦我从FeatureGroup中移除,我就开始获得我所期望的行为