WiX: Utilizing multiple cabs in a very large application
Asked Answered
P

1

5

I've recently started learning and utilizing WiX, and my first true project with WiX is repackaging a custom configuration of Qt. It's been quite a challenge, as the Qt project is massive.

I've managed to smash my way very inelegantly through the process, but have recently reached a snag during linking. I've been receiving Light.exe error "LGHT0296", most likely because I was creating a CAB that was much greater than 2 GB. After trying for the highest compression level, and having that not make a difference, the only option left to me is to split the installation package into more than one CAB file (Side note: The error returned was extraordinarily helpful in telling me what courses of action to try).

Anyway, I've found myself a bit lost when it comes to creating multiple CAB files. I'm not entirely sure what I should do in this case, and I haven't been able to find any helpful documentation or examples where this splitting is done. What's the best way for me to go about doing this?

Thanks.

Papilionaceous answered 18/2, 2010 at 17:17 Comment(0)
B
7

You just declare multiple media elements like this:

  <Media Id='1' Cabinet='package1.cab' EmbedCab='no'/> 
  <Media Id='2' Cabinet='package2.cab' EmbedCab='no'/>

If you have enough space on your installation media and would rather eliminate the time and disk space that the installer uses to unpackage files, then you can also put unpackaged files in some folder relative to the MSI like this (you can even create an MSI that installs itself that way):

  <Media Id='3' Layout="./somefolder" />

Finally, you chose in which media to put each file by adding a DiskId attribute like this:

  <File Source="./somefile" DiskId="2" />
Brownell answered 18/2, 2010 at 17:56 Comment(2)
Ok, great. Looks like I was on the right track, I just need to assign DiskIds to the individual files. The only problem is I have over 30k files. Is there an easy way to do this, or should I just make a script to do it? (Seems like this DiskId might be a good switch to add to Heat?)Papilionaceous
You can use an XSLT to add DiskId to all File elements using Heat's -t switch or the Transform attribute of HeatDirectory in a wixproj. I use Heat to dynamically generate wxs files at every build. XSLTs can be used to remove files or replace the heat Id with a static one.Soult

© 2022 - 2024 — McMap. All rights reserved.