0

我是 wix 的新手,并且在使用 wix 中的 copyfile 组件时遇到了一些问题。请您查看下面的代码并提供建议。非常感谢。

我有 3 个功能、3 个组件组和 3 个组件,如下所述,以及相应的 directoryRef

<Feature Id = "F1" Title "T1" Level ="1">
  <ComponetGroupRef Id="CG1" />
  <Condition Level="1">
    <![CDATA[ComputerName="S1"]
  </Condition>
</Feature>

<Feature Id = "F1" Title "T1" Level ="1">
  <ComponetGroupRef Id="CG2" />
  <Condition Level="1">
    <![CDATA[ComputerName="S2"]
  </Condition>
</Feature>

<Feature Id = "F1" Title "T1" Level ="1">
  <ComponetGroupRef Id="CG3" />
  <Condition Level="1">
    <![CDATA[ComputerName="S3"]
  </Condition>
</Feature>

<ComponentGroup id="CG1">
  <ComponentRef id="c1" />
</ComponentGroup>

<ComponentGroup id="CG2">
  <ComponentRef id="c2" />
</ComponentGroup>

<ComponentGroup id="CG3">
  <ComponentRef id="c1" />
  <ComponentRef id="c2" />
</ComponentGroup>

<DirectoryRef Id"ApplicationDirectory">
  <Component Id="C1" Guid="xyz">
    <File Id="F1"KeyPath="yes" Source="Some Source Location">
      <CopyFile Id="CF1" DestinationDirectory="Dest1" />
    </File>
  </Component>
  <Component Id="C2" Guid="abc">
    <File Id="F2"KeyPath="yes" Source="Some Source Location">
      <CopyFile Id="CF2" DestinationDirectory="Dest2" />
    </File>
  </Component>
</DirectoryRef>

所以基本上,如果我在服务器 S1 上运行 wix msi,则仅应复制文件 F1,当我在服务器 S2 上运行时,仅应复制文件 F2,而当我在服务器 S3 上运行时,应复制文件 F1 和 F2。

我遇到的问题是所有文件都被复制而不受限制或服务器名称匹配。

如果我是愚蠢的,你能告诉我。

谢谢,贾纳克

4

1 回答 1

0

Wix is not for copy. I defined a different wix template project for the work I wanted to do. So instead of copy from destination to another location. I changed the project implementation so that it copies from source to a different destination.

于 2013-08-06T09:28:46.673 回答