Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
235 views
in Technique[技术] by (71.8m points)

wix3 - Reusing WIX components to speed up candle/light

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="..OutputNewRiverDigitalMaps.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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 pathodirectoryforcabinets

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...