将文件夹添加到安装程序中的 wix 不是文件? [英] Add a folder to installer in wix not files?

查看:31
本文介绍了将文件夹添加到安装程序中的 wix 不是文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的安装程序必须将文件复制到 installdir...我的应用程序有大约 2000 个文件,我无法编写脚本将每个文件添加到安装程序.wix 中是否有任何选项,以便我可以一次添加所有文件或包含文件的整个文件夹?我是 wix 的新手,我没有在任何教程中找到任何选项...请帮助我并提前致谢.....

My installer has to copy files into installdir... My application has around 2000 files and it is not possible for me to write the script to add each and every file to the installer. Is there any option in wix so that I can add all the files or the entire folder consisting the files at once? I am new to wix and i didnt find any option in any tutorial for this... Please do assist me and thanks in advance.....

推荐答案

Heat is the WiX 收获工具.您可以在目录上运行它以生成必要的 WiX 源代码.

Heat is the WiX harvest tool. You can run it on a directory to generate the necessary WiX source code.

如果你想在你的 VS 项目构建之前运行 heat,将它添加到你的项目预构建事件中,如下面的屏幕截图所示(这是我如何设置我的项目来为我们不断变化的帮助内容动态生成 W​​iX 源):

If you want to run heat before your VS project builds, add it to your project prebuild events as seen in the screenshot below (this is how I have my project setup to dynamically generate WiX source for our ever changing help content):

注意我拥有的 -var wix.HelpSource 开关.heat 生成的 WiX 源文件会将源文件的位置设置为该变量,而不是对其进行硬编码.因此生成的源代码将包含如下所示的组件:

Note the -var wix.HelpSource switch that I have. The WiX source files generated by heat will set the location of the source files to that variable instead of hard-coding it. So the generated source will have components that look something like this:

<Component Id="Welcome.htm" Directory="Content" Guid="INSERT-GUID-HERE">
  <File Id="Welcome.htm" KeyPath="yes" Source="!(wix.HelpSource)\Content\Welcome.htm" />
</Component>

在我的特殊情况下,我在 WiX VS 项目的工具设置屏幕上将该变量定义为相对目录 ..\..\Help\Output,如下所示:

And in my particular case, I define that variable on the Tool Settings screen of my WiX VS project to the relative directory ..\..\Help\Output as seen below:

注意: 以这种方式收集文件将导致每次构建时收集的组件的 GUID 都会发生变化.如果您不希望更改 GUID,您可能需要编写一些调用 heat 来收集文件的包装器,然后更新您的原始 WiX 源,保留所有 GUID.

NOTE: Harvesting files in this manner will cause the GUIDs of the components harvested to change every time you build. If you don't want your GUIDs to change, you may have to write some wrapper that calls heat to harvest the files, then updates your original WiX source, leaving all the GUIDs alone.

这篇关于将文件夹添加到安装程序中的 wix 不是文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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