重用 WIX 组件来加速蜡烛/灯 [英] Reusing WIX components to speed up candle/light

查看:21
本文介绍了重用 WIX 组件来加速蜡烛/灯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 WIX 还很陌生,所以如果我完全错过了这里的船,请原谅我,但我想知道是否可以重用 wxs 文件中的组件(mwm、cab 等)而无需重新使用- 每次都链接它们.我正在使用的安装程序有几个可执行文件、dll 和配置文件,这些文件往往会在每次安装之间发生变化.这些文件相当于大约 5 兆的安装程序.我想重用的部分是价值约 350 兆的图像/地图/数据库文件,这些文件不会经常更改,我不想在每次构建安装程序时都必须编译/链接.

我尝试为地图创建一个 mwm 文件,但是当我在 wxs 中引用它们时,它们通过光链接到主 .msi 文件中.我试过指定一个非嵌入的 CAB 文件来保存地图:

<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 的操作吗?我读过关于片段的文章,但这似乎不是我要找的.

谢谢,大卫

解决方案

你的直觉绝对会引导你走向正确的方向.您正在寻找的功能称为cab-cache".您可以通过将以下内容添加到 light.exe 命令行来使用它:

-reusecab -cc path\to\directory\for\cabinets

注意:编译(candle.exe)和链接(light.exe 的前半部分)应该很快发生.通常较慢的是绑定(第二个是 light.exe),因为它实际上涉及所有文件并构建文件柜.机柜建造是最慢的部分,所以希望驾驶室缓存能够为您充分加快速度.

P.S.:如果编译需要很长时间,您可以创建.wixlib";用lit.exe.我在这里有更多关于 .wixlibs 的信息:http://robmensching.com/blog/posts/2008/10/10/What-are-.wixlibs-and-why-would-you-use-them

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

解决方案

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:

-reusecab -cc path\to\directory\for\cabinets

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

这篇关于重用 WIX 组件来加速蜡烛/灯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆