如何排除文件被热收获 (WiX 3.5)?

发布于 2024-09-19 19:50:53 字数 84 浏览 7 评论 0原文

我想使用 heat.exe 收获一个包含大量文件的文件夹。但我不想收集所有文件,而是想排除特定的文件扩展名,例如“*.txt”或类似的文件。 我该怎么做?

I would like to harvest a folder with a lot of files by using heat.exe. But instead of harvesting all files, I would like to exclude specific file extensions like "*.txt" or something like that.
How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

晒暮凉 2024-09-26 19:51:07

我没有尝试弄清楚如何从文件夹中获取选定的文件,而是使用构建前操作仅使用我想要获取的文件填充文件夹。以下工作流程对我有用:

  1. 删除“文件”(如果存在
  2. ) 创建“文件”文件夹
  3. 将文件复制到“文件”文件夹。我使用 robocopy 构建操作,这给了我足够的控制权来指定要包含或排除的文件。
  4. 收获整个文件夹。

我将其设置为有条件地运行收获操作,仅用于调试版本。发布版本是从我们的 TFS 服务器生成的,并使用源代码管理中生成的 .wxs。在构建服务器上运行收获应该没问题,但这是一个额外的步骤,不运行它可以消除 克里斯托弗·画家。除了这一步骤之外,构建服务器上执行的步骤与我的开发计算机上执行的步骤相同。

Instead of trying to figure out how to harvest selected files from of a folder, I use a before build action to populate a folder with just the files that I want harvested. The following workflow has been working for me:

  1. Delete a "files" if it exists
  2. Create a "files" folder
  3. Copy the files to the "files" folder. I use the robocopy build action, that gives me enough control to specify which files to include or exclude.
  4. Harvest the entire folder.

I have it set to run the harvest action conditionally, just for debug builds. Release builds are generated from our TFS server and use the generated .wxs from source control. It should be OK to run harvest on the build server, but it's an extra step and not having it run eliminates the "non-deterministic process" problem described by Christopher Painter. Other than that one step, the same steps execute on the build server as they do on my dev machine.

世态炎凉 2024-09-26 19:51:04

我并不是这种模式的大力支持者。使用非确定性流程时如何确保变更控制?您如何知道目录中出现的文件确实应该在产品中发布,以及如何知道从目录中消失的文件不应破坏构建?您如何知道您正在违反组件规则并造成可服务性问题?

我曾经在 20 世纪 90 年代做过动态文件链接,因为它很“简单”,但我记得它让我痛苦了很多次,从那以后我就再也没有这样做过。

我知道 Bob Arnson 曾经同意这个观点:

http://www.mail-archive.com/[电子邮件受保护]/msg03420.html

但是现在是 WiX 3.5 我我开始看到支持动态链接的功能,但我只是不明白为什么它们会那样做。我宁愿更新 WXS 文件并将其重新检查到源代码管理中,然后冒险将我的部署过程置于自动驾驶仪上。

I'm not a huge proponent of this pattern. How do you ensure change control when using a non-deterministic process? How do you know a file that appeared in a directory really should ship in a product and how do you know a file that vanished from the directory shouldn't break a build? How do you know you are breaking the component rules and creating servicability issues?

I used to do dynamic file linking in the 1990's because it was "easy" but I can remember it biting me many times and I haven't done it ever since.

I know Bob Arnson used to agree with this view point:

http://www.mail-archive.com/[email protected]/msg03420.html

But now in WiX 3.5 I'm starting to see capabilities that support dynamic linking and I just don't understand why they would go that way. I'd much rather update a WXS file and check it back into source control then risk putting my deployment process on autopilot.

真心难拥有 2024-09-26 19:51:02

我认为现在唯一的选择是收获整个文件夹并对生成的 .wxs 文件应用转换(请参阅 -t: 开关)以排除不需要的内容(txt 文件)在你的情况下)。不过,我没有尝试过heat的3.5版本(根据3.0来判断),但我不认为这方面有什么变化。

I think the only option for now is to harvest the entire folder and apply a transform to the resulting .wxs file (see -t:<xsl> switch) to exclude what is not required (txt files in your case). However, I didn't try the 3.5 version of heat (judging based on the 3.0), but I don't think there are changes in this area.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文