热生成的文件无法找到 SourceDir 目录 [英] heat generated files are not able to find SourceDir directory

查看:15
本文介绍了热生成的文件无法找到 SourceDir 目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 heat 来生成一个 wxs 文件.代码如下.

I am running heat to generate a wxs file. The code are as follows.

我想将 dir.prompts 中的所有文件添加到安装程序中的 wxs 文件中.我将其添加为自动构建过程的一部分(这样我就无法在生成 wxs 文件后对其进行修改).

I want to add all the files from dir.prompts to the wxs file in the installer. And I added this to be a part of the automated build process ( so that I cant modify the wxs file once it has been generated).

wxs 文件生成,如下所示.然而,Light 抱怨它找不到 SourceDirValid.wav 的位置.所以我想我的问题是,SourceDir 是我从中读取文件的目录,还是我不知道的某个魔法目录?非常感谢.

The wxs file is generated, and it looks something like the following. Hoewever, then Light complains it can not find where SourceDirValid.wav is. So I guess my question is, is SourceDir the directory that I am reading the files from, or some magic directory that i am not aware of? Many thanks.

 <Fragment>
    <ComponentGroup Id="COMPONENTS">
        <Component Id="dmp120F8C2794******" Directory="dir31A7EE61C56025FE2564A81E28E8C132" Guid="{6D40EBC0-***-***-B972-**********}">
            <File Id="fil919100C2******D045EC131" KeyPath="yes" Source="SourceDirValid.wav" />
        </Component>



<exec program ="${dir.wix}heat.exe">
  <arg value = "dir"/>
  <arg line = "${dir.prompts}"/> 
  <arg value= "-gg"/>
  <arg line="-cg &quot;COMPONENTS&quot;"/>
  <arg line = "-out  &quot;${dir.thisinstaller}\COMPONENTS.wxs&quot;"/> 
</exec>

推荐答案

你应该在 heat 命令行中添加 -var 开关:

You should add -var switch to heat command line:

来自 heat.exe 帮助:

From heat.exe help:

-var VariableName 替换 File/@Source=SourceDir"

-var VariableName substitute File/@Source="SourceDir"

使用预处理器或 wix 变量.例如:

with a preprocessor or a wix variable. For example:

-var var.MySource

将变为 File/@Source="$(var.MySource)myfile.txt"

will become File/@Source="$(var.MySource)myfile.txt"

-var wix.MySource

将变为 File/@Source="!(wix.MySource)myfile.txt"

will become File/@Source="!(wix.MySource)myfile.txt"

这篇关于热生成的文件无法找到 SourceDir 目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆