18

私は単純なWindowsを統合しようとしていますが、これに対処する方法がわかりません。私には2つの機能があります-feature1とfeature2です。ユーザーが機能1をインストールすることを選択した場合にのみ機能2をインストールしたい。だから私は試しました:

<Feature Id='core' Title='Core'
         Description='ØMQ 1.0.0 core functionality and C++ API' Level='1'>
  <ComponentRef Id='Core_include' />
  <ComponentRef Id='Core_bin' />
  <ComponentRef Id='Core_lib' />
  <ComponentRef Id='Core_zmq' />
  <ComponentRef Id='cpp_bin' />
</Feature>

<Feature Id='core_perf' Title='core_perf' Description='0MQ core perf' Level='999'>
    <Condition Level="0">NOT (&amp;core = "3")</Condition>
        <ComponentRef Id='cpp_perf' />
</Feature>

ただし、ユーザーが機能コアを選択した場合、これは機能core_perfをインストールしません。

どうすればこれを修正できますか?

4

2 に答える 2

16

条件をコンポーネント定義に移動し、! を使用する必要があります。& (機能アクション) の代わりに (機能状態) を使用すると、インストールを 2 回目に再実行して例を追加しようとしたときに機能します。

<Component Id="example1">
    <Condition>!feature1 = 3</Condition>
</Component>

<Component Id="example2">
    <Condition>!feature2 = 3</Condition>
</Component>

<Feature Id="feature1">
</Feature>

<Feature Id="feature2">
</Feature>

<Feature Id="examples">
    <ComponentRef Id="example1" />
    <ComponentRef Id="example2" />
</Feature>
于 2009-07-21T15:16:46.457 に答える
7

feature1 を feature2 の親にすることを検討しましたか? 次に、feature1 もインストールしない限り、feature2 をインストールできません。条件は必要ありません。

<Feature Id='core' Title='Core' 
         Description='ØMQ 1.0.0 core functionality and C++ API' Level='1'>
    <ComponentRef Id='Core_include' />
    <ComponentRef Id='Core_bin' />
    <ComponentRef Id='Core_lib' />
    <ComponentRef Id='Core_zmq' />
    <ComponentRef Id='cpp_bin' />
    <Feature Id='core_perf' Title='core_perf' Description='0MQ core perf' 
             Level='999'>
        <ComponentRef Id='cpp_perf' />
    </Feature>
</Feature>
于 2013-01-09T23:44:53.887 に答える