在 Visual Studio 2008 和 WiX(v3) 中使用 heat.exe 获取 .csproj

发布于 2024-07-16 09:18:16 字数 738 浏览 7 评论 0原文

我发现 Wix v3 使用一个工具(heat.exe)将信息“收获”到 WiX 片段中。 要么我找错了位置,要么这记录很少。

为包含媒体文件的复杂文件夹结构自动生成 WiX 片段(可能使用 heat.exe)的最佳方法是什么:

  • 不同类型(ico/png/xaml/等)
  • 可能会定期更改(名称/位置/添加/删除)
  • 被归类为“内容”并包含在 .csproj 中,

以便它们可以通过 WiX 内置到安装程序中,并且可以承受升级和补丁?

背景信息

  1. 我发现 heat.exe,它似乎解决了自动生成 WiX 片段的要求
  2. 在让“dir”收割机工作时,我注意到“项目”收割机(命令行帮助)
  3. 媒体已经在 C# 项目文件中,因此注意到“ -pog:Content" 可能会做得很好
  4. 粗略搜索发现过时的文档没有提到“项目”收割机
  5. 意识到整个项目安装程序可能可以使用“项目”收割机完成,但不确定它的支持程度如何,以及陷阱是。
  6. 看到了“PUT-GUID-HERE”的生成,并意识到自动生成的 GUID 可能会产生升级/补丁的影响。
  7. 意识到一定有人将这些工具用于类似的目的,并且可能会为我指明正确的方向。

有人(公平地)指出 v3 尚未“完成”(因此文档和教程稀缺)。 我现在的感觉是,在我的构建脚本中自动执行此操作并非易事,并且现在的工具正在不断增长以缓解此问题。

I found that Wix v3 uses a tool (heat.exe) to "harvest" information into WiX fragments. Either I am looking in the wrong location, or this is thinly documented.

What is the best way to auto-generate a WiX fragment (likely using heat.exe) for a complex folder structure that contains media files:

  • Of varying types (ico/png/xaml/etc)
  • That may change regularly (names/locations/adds/removes)
  • That are classified as "Content" and included in a .csproj

such that they can be built into an installer via WiX and would withstand upgrades and patches with decorum?

Background Information

  1. I found heat.exe, which seems to solve the autogenerate WiX fragment requirement
  2. In getting the "dir" harvester working, I noticed the "project" harvester (commandline help)
  3. Media is already in C# project file, and so noted that "-pog:Content" might do very well
  4. Cursory search found out of date documentation that didn't mention "project" harvester
  5. Realized entire project installer could probably done with "project" harvester, but was unsure how well this was supported, and what the pitfalls were.
  6. Saw the generation of "PUT-GUID-HERE" and realized that autogeneration of guids would likely have upgrade/patch implications.
  7. Realized that there must be people who use these tools for similar purposes and could probably point me in the right direction.

It was (fairly) pointed out that v3 is not yet "done" (thus the scarceness of documentation and tutorials). The sense that I get now is that it is non-trivial to automate this in my build scripts, and the tools are growing right now to ease this.

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

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

发布评论

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

评论(4

白昼 2024-07-23 09:18:16

根据我的经验,约翰·罗宾斯的 Paraffin 解决了tallow.exe(v3 中的 heat.exe)的许多问题。 我不确定 Paraffin 是否能很好地与 v3 配合使用,但它可能值得一试。

仅供参考,我在构建过程中使用了 Paraffin,它允许我删除之前涉及 powershell 脚本的 2-3 步骤清理过程。

In my experience John Robbins' Paraffin solves alot of the issues with tallow.exe (heat.exe in v3). I'm not sure if Paraffin plays nicely with v3, but it might be worth checking out.

FYI, I've used Paraffin in a build process and it allowed me to remove the previous 2-3 step cleanup process that involved a powershell script.

|煩躁 2024-07-23 09:18:16

有关自动生成的设置的升级影响,阅读本文。 带回家的信息:

Windows Installer 不允许您
在小升级中删除组件

如果自动生成安装程序,则很难保证组件继续存在。 因此,您必须在自动生成组件和进行较小升级的能力之间做出选择。

如果您有一些自动生成的组件,那么只需坚持进行重大升级即可。 您可以使用Rob 提供的示例作为示例。

For the upgrade implications of auto-generated setups, read this. The take-home message:

Windows Installer doesn’t let you
remove components in a minor upgrade

It is hard to guarantee that components continue to exist if you generate your setup automatically. Therefore you have to chose between auto-generation of components and the ability to do minor upgrades.

If you have some auto-generated components, then just stick to major upgrades. You can use this sample by Rob as an example.

千寻… 2024-07-23 09:18:16

感谢您的背景介绍,我不知道他们正在开发新版本的 Wix。 根据项目页面,它还不是 RTM,因此这可以解释您遇到的问题。 我希望在其中一份回复中听到 WIX 开发人员的声音。

我无法帮助您使用正在开发的 heat.exe 功能。 但是,我遇到过您的情况,我的解决方案是创建一个工具,该工具将目录和文件信息作为输入,并生成有效的 wix 项目文件作为输出。 .vsproj 文件只是一个 XML 文件,您可以使用 XSL、C# 的 LINQ、PowerShell 或许多其他工具来完成这项工作。 为此,我个人曾使用(LINQ 之前的)C#/XMLDOM 来解析 VS 项目文件。

祝你好运,

戴夫

Thanks for the background, I wasn't aware that they were working on a new version of Wix. According to the project page, it isn't RTM yet, so that may explain the problems you're having. I hope to hear from the WIX developers in one of the replies.

I can't help you use the under-development heat.exe features. However, I have been in your situation and my solution was to create a tool that took directory and file information as input and generated valid wix project files as output. A .vsproj file is just an XML file, and you can use XSL, C#'s LINQ, PowerShell, or a number of other tools to do the work. I personally have used (pre-LINQ) C#/XMLDOM to parse VS project files for this purpose.

Good Luck,

Dave

妞丶爷亲个 2024-07-23 09:18:16

有关文档,请查看随 WiX 安装的帮助文件 - WiX.chm 提供最新信息(以及命令行 -help 选项)。

For documentation, check out the help file that is installed with WiX - WiX.chm provides the most up to date information (along with the command line -help option).

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