我对 WIX 相当陌生,所以如果我完全错过了这里的船,请原谅我,但我想知道是否可以在 wxs 文件中重用组件(mwm、cab 等),而无需重新链接它们每次。 我正在开发的安装程序有几个可执行文件、dll 和配置文件,这些文件在每次安装之间都会发生变化。 这些文件相当于安装程序的大约 5 兆。 我想要重用的部分是大约 350 meg 的图像/地图/数据库文件,这些文件不会经常更改,因此我不想在每次构建安装程序时都必须编译/链接。
我尝试为地图创建一个 mwm 文件,但是当我在 wxs 中引用它们时,它们通过灯光链接到主 .msi 文件中。 我尝试指定一个非嵌入式 CAB 文件来保存地图:
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Media Id="2" Cabinet="NewRiver.cab" EmbedCab="no" CompressionLevel="none" />
...
<Merge Id="NewRiverDigMap" SourceFile="..\Output\NewRiverDigitalMaps.msm" Language="1033" DiskId="2" />
但是每次灯光运行时,都会重新生成独立的 CAB 文件 - 这需要一段时间。
我想过只创建一个 ZIP 文件与 msi 一起提供,然后让安装程序启动 zip 解压,但这对我来说似乎是反 wix 的。 我希望在不再需要这些文件时将其删除。
我还缺少其他类似 wix 的操作吗? 我读过有关片段的内容,但这似乎不是我要找的。
谢谢,
大卫
I am fairly new to WIX, so forgive me if I'm completly missing the boat here, but I was wondering if it was possible to reuse components (mwm,cab,etc) from within a wxs file without having light re-link them every time. The installer I'm working on has several executables, dlls and config files that tend to change between each install. These files amount to about 5 meg worth of installer. The part I want to reuse is the ~350 meg worth of image/map/database files that do not change very often that I don't want to necessarilly have to compile/link every time the installer is built.
I've tried creating a mwm file for the maps, but when I reference them within the wxs, they get linked via light into the main .msi file. I've tried specifing a non embedded CAB file to hold the maps:
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Media Id="2" Cabinet="NewRiver.cab" EmbedCab="no" CompressionLevel="none" />
...
<Merge Id="NewRiverDigMap" SourceFile="..\Output\NewRiverDigitalMaps.msm" Language="1033" DiskId="2" />
But every time light runs, the stand-alone CAB file gets regenerated - which takes a while.
I thought about just creating a ZIP file to deliver along with the msi and have the installer just kick off the zip extract, but that seems anti-wix to me. I'd like to have the files be removed when they are no longer needed.
Are there any other wix like operations that I'm missing? I've read about fragments, but that doesn't seem to be what I'm looking for.
Thanks,
David
发布评论
评论(1)
你的直觉绝对会引导你走向正确的方向。 您正在寻找的功能称为“cab-cache”。 您可以通过将以下内容添加到 light.exe 命令行来使用它:
注意:编译(candle.exe)和链接(light.exe 的前半部分)应该很快发生。 通常缓慢的是绑定(light.exe 的第二个),因为它实际上涉及所有文件并构建橱柜。 机柜构建是最慢的部分,因此希望机柜缓存能够充分加快速度。
PS:如果编译需要很长时间,您可以使用 lit.exe 创建“.wixlib”。 我在这里有更多关于 .wixlibs 的信息: http://robmensching.com/blog/posts/2008/10/10/What-are-.wixlibs-and-why-would-you-use-them
Your intuition is absolutely leading you in the right direction. The feature you are looking for is called "cab-cache". You use it by adding the following to your light.exe command-line:
Note: Compiling (candle.exe) and linking (first half of light.exe) should happen very quickly. What is usually slow is the binding (second have of light.exe) because it actually touches all of the files and builds the cabinets. Cabinet building is the slowest part, so hopefully the cab-cache speeds things up sufficiently for you.
P.S.: If compiling is taking much time you can create ".wixlib" with lit.exe. I have more about .wixlibs here: http://robmensching.com/blog/posts/2008/10/10/What-are-.wixlibs-and-why-would-you-use-them