Wix Toolset复制文件问题

时间:2012-12-20 17:30:17

标签: visual-studio-2012 wix wix3.6

我是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&amp; F2都应该被复制。

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

你能否告诉我是否愚蠢。

谢谢, JANAK

1 个答案:

答案 0 :(得分:0)

Wix不是复制品。 我为我想做的工作定义了一个不同的wix模板项目。因此,而不是从目的地复制到另一个位置。我更改了项目实现,以便从源复制到另一个目标。

相关问题