我们决定从 VS 集成设置切换到 WiX。
但是,我们当前所做的是使用项目输出文件作为设置项目的输入。 这使我们可以轻松地将应用程序文件添加到目录(用于图像、示例和其他资源...),并且在构建时这些文件会自动添加到设置中。
我在 WiX 中找不到任何类似的功能。 WiX 似乎需要为每个目录和文件提供一个目录条目和一个文件条目。 这需要我们在每次添加文件时更改 WiX 源,在我看来,这是令人望而却步的,因为我们有太多文件。
有没有任何集成的方法可以使用 WiX 来做到这一点,或者我是否必须编写自己的任务来在调用蜡烛之前创建一个 WiX 源?
We decided to switch from VS integrated setup to WiX.
However, what we currently do is use projects output files as the input for the setup project. This lets us easily add Application Files to a directory (for images, samples, and other resources...) and those files are automatically added to the setup when we build.
I could not find any similar feature in WiX. WiX seems to require one Directory entry and one File entry for each and every directory and file. This would require us to change the WiX source everytime a file is added which, to my eyes, is prohibitive since we have so many of them.
Is there any integrated way of doing that with WiX or do I have to write my own task that will create a WiX source before calling candle?
发布评论
评论(5)
对于 WiX 2.0,牛脂非常有限; 石蜡和锦葵提供额外的功能。
对于 WiX 3.0,热量提供与牛脂相同的功能,但稍微好一点。
就我而言,我使用了 mallow 源并进行了一些修改并使用它,因为石蜡需要 3.5 版本的 .Net。
您可以使用 Mallow
或 Paraffin 工具生成 WiX 片段:
开始使用,
WiX 的痛苦,
更好的牛脂, 石蜡,
下载,
用于 WiX 3.0 的石蜡
For WiX 2.0, tallow is very limited; paraffin and mallow offer additional functionality.
For WiX 3.0, heat offers the same functionnality as tallow, a little bit better.
In my case I've used mallow source and modified a bit and used it, because paraffin needs 3.5 version of .Net.
You can use Mallow
or Paraffin tool to generate WiX fragments:
Getting started,
The pain of WiX,
A better tallow, Paraffin,
Download,
Paraffin for WiX 3.0
我一直在 WIX 3.5 中使用 heat.exe 就是为了这个目的。 不过,上次我检查时,文档不是最新的 3.5 版本,因此请保留心里。
这是一个例子:
I've been using heat.exe in WIX 3.5 just for that purpose. Last time I checked though, the documentation wasn't up-to-date with 3.5 release so keep that in mind.
Here is an example:
MapGuide 开源项目目前正在使用 John Robbins 的 石蜡 3.0 正如其他人指出的那样。
基本上,第一次使用给定的发行版本时,我们将使用“生成”操作,为源文件夹创建新的 .wxs 文件,并为每个文件提供特定选项。
在同一版本的后续版本中,“重新生成” 操作被调用以确保 .wxs 文件已使用已添加的任何新文件/目录进行更新。
我相信 Heat v3 现在也允许您做很多(或者全部?),如 布莱恩·罗杰斯写道。 我仍然对 Paraffin 通过维护静态 GUID 更明确地做到这一点的方式感到更舒服,但当前的 Heat 看起来是一个不错的选择。
The MapGuide Open Source project is currently using John Robbins' Paraffin 3.0 as others have pointed to.
Basically, the first time through for a given release version, we'll run our installer script with a "generate" action that creates new .wxs files for source folder with specific options for each one.
On subsequent builds of the same version, the "regen" action is called to ensure that the .wxs files are updated with any new files/directories that have been added.
I believe that Heat v3 also now allows you to do a lot (or maybe all?) of this, as Brian Rogers writes . I still feel more comfortable with the way that Paraffin does this more explicitly by maintaining static GUIDs, but the current Heat looks like a good option.
经过进一步研究,似乎有一个名为tallow.exe 的包含二进制文件可以做到这一点。 它通过递归搜索文件从目录创建片段。
After further research, it seems there is an included binary called tallow.exe that does just that. It creates a fragment from a directory by recursively searching for files.
在我使用 WIX 的过程中,我从未遇到过可以一次添加整个文件目录的功能。 这是因为给定文件的使用方式有很多种(系统不知道您以后是否要引用该文件夹中的特定文件等......并且它需要知道它们),而且因为安装本身需要非常具体。
这并不妨碍您为 WIX 编写自己的前端,该前端将在解析目录结构的内容后生成 WIX XML 文件(或其部分)。 这基本上就是我们在工作中使用的系统之一的作用。 它与任何代码或文本文件生成实用程序的想法相同。 只需遍历树并生成适当的文本即可。
编辑:这样,您可以将 WIX 视为定义设置的“低级语言”,并将实用程序视为“高级语言”。 如果您需要帮助编写一份,请告诉我们。
此外,您还可以通过将此实用程序添加到 VStudio 中的自定义构建步骤来生成 WIX 文件作为构建过程的一部分。 这样,您实际上就没有任何人构建的“已保存的 WIX 文件”,系统只是在最后构建它,并在构建后步骤中自动考虑新文件。
In my use of WIX, I have never come across a feature that lets you add a whole directory of files at a time. This is because there are many ways a given file can be used (the system doesn't know if you'll later want to refer to a specific file in that folder, etc... and it needs to know them), and also because the install itself needs to be pretty specific.
That doesn't stop you from writing your own frontend for WIX that will generate the WIX XML file (or portions of it) after parsing through a directory structures' contents. That's basically what one of the systems we use at my work does. It's the same idea as any code or text file generation utility. Just traverse through the tree, and generate the appropriate text.
EDIT: In that way, you can consider WIX to be the "low-level language" for defining the setup, and your utility as the "high-level language". If you need help writing one, let us know.
Also, you can have the WIX file be generated as part of the build process by adding this utility to the custom build steps in VStudio. That way you don't actually have a "saved WIX file" that anyone builds, the system just builds it at the end, automatically taking new files into account at the post-build step.