WiX 包含与片段
- WiX 包含文件(
.wxi
文件)和 WiX 片段(.wxs
文件)之间有什么区别? - 每个的用例是什么?
- 应该使用哪个以及为什么?
- What's the difference between a WiX include (
.wxi
file) and a WiX fragment (.wxs
file)? - What are the use cases for each?
- Which should be used and why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
文件扩展名只是为了方便,文件的内容才是真正重要的。 这种区别使得管理实际安装(wxs 文件)和创建安装所需的属性(wxi 文件)之间的差异变得更加容易。
例如,您的 wxs 文件指定产品及其内容(您安装的文件),而您将使用 wxi 文件指定产品版本、升级代码、公共路径等。WiX
文档提供了一些明确的信息。
The file extension is a convenience, the content of the file is what really matters. The distinction makes it easier to manage the difference between the actual installation (wxs files) and the properties required to create the installation (wxi files).
For example, your wxs files specify the product and its contents (which files you install) whereas you would use your wxi files to specify product version, upgrade codes, common paths, etc.
The WiX documentation provides some clear information.
就我个人而言,我只使用 .wxi 文件来包含常见的
。 我将产品的其余部分组织成许多不同逻辑的片段分组。 将片段视为典型过程语言中的函数。 将类似的东西放在一起,不要让它们太长。
Personally, I only use .wxi files to include common
<?define?>
s. I organize the rest of my product into many different logical groupings of Fragments. Treat Fragments like functions in your typical procedural language. Group like stuff together and don't make them too long.需要注意的一件事是,将 wxs 文件添加到项目中意味着 MSBuild 将在您更新 wxs 文件时执行增量构建。 包含 wxi 文件不会执行此操作。
但另一方面,当您包含在 msi 中的任何文件已更新时,MSBuild 不会执行自动构建,因此您可能不会执行增量构建。
One thing to be aware of is that adding a wxs file to your project implies that MSBuild will do an incremental build when you update the wxs file. Including a wxi file does not do this.
But on the other hand, MSBuild is not doing automatic builds when any of the files you're including into your msi have been updated, so you're probably not doing incremental builds anyway.