【问题标题】:Wix Toolset copy file issueWix Toolset 复制文件问题
【发布时间】:2016-01-13 00:58:58
【问题描述】:

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

我有 3 个功能、3 个组件组和 3 个组件,如下所述,分别带有相应的目录参考

<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 都应该被复制。

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

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

谢谢, 贾纳克

【问题讨论】:

  • 片段中有目录层次结构吗? dest1/2 定义在哪里?

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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-20
    • 1970-01-01
    • 2012-08-02
    • 2017-10-27
    • 1970-01-01
    • 1970-01-01
    • 2010-09-17
    • 1970-01-01
    相关资源
    最近更新 更多