问题描述
是否可以在 wixlib 中包含源"文件?
Is it possible to include "source" files in a wixlib?
我有许多 c++ 解决方案,每个解决方案都包含一个或多个项目和一个 wixlib,其中一个片段包含以下条目:
I have a number of c++ solutions, each containing a project or projects, and a wixlib, with a fragment containing entries such as:
<File Id="MY_ID" KeyPath="yes" Source="$(var.my_path)\foo.exe" />
我想收集foo.exe"并将其包含在 wixlib 中,然后创建一个 WiX 项目,将多个此类 wixlib 链接在一起并生成一个 MSI.
I would like to collect "foo.exe" and include it in the wixlib, then create a WiX project that links together several such wixlibs and produces an MSI.
我所做的阅读似乎表明 WiX3 和更高版本支持这一点,技术是首选使用合并模块.
The reading I have done seems to suggest WiX3 and later supports this, and the technique ispreferred to using merge modules.
目前,我使用环境变量来描述二进制文件的路径,light.exe 在链接时使用它来定位文件.但是,它有以下缺点:
Currently, I use an environment variable describing the path to the binary files, which gets used by light.exe at the time of linking to locate the files.However, it has the following disadvantages:
- 在编译 wixlibs 和将 wixlibs 链接到 MSI 之间要更改的文件版本,以及
- 特定于用于构建 wixlib 的环境(例如:如果 wixlib 编译和链接发生在不同的机器上,则两者都需要构建所需的二进制文件)
推荐答案
我自己对 wixlib 的经验并不多,但这不就是 -bf
切换 lit 的原因吗?exe
用于?来自 lit.exe 帮助文本:
I don't have much experience with wixlib myself, but isn't it what -bf
switch of lit.exe
for? From lit.exe help text:
-bf bind files into the library file
这篇关于是否可以包括“来源"?wixlib 中的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!