2

Is it possible to make a WiX installation bundle with size of total .msi's and exe's inside bundle more than 2GB? Currently in my .wxs template I have a <chain> inside of a <bundle> that contains multiple <MsiPackage>'es. I haven't created that WiX template on my own, I'm just improving/fixing bugs in a legacy project, so I am not very proficient with the WiX toolset. Anyway, then I create a .wixobj out of that .wxs template with candle.exe and this .wixobj I feed to light.exe. It seems that if total size of content to link is more than 2GB light.exe fails with error:

error LGHT0306 : An error (E_FAIL) was returned while finalizing a CAB file. This most commonly happens when creating a CAB file with more than 65535 files in it. Either reduce the number of files in your installation package or split your installation package's files into more than one CAB file using the Media element.

I looked for solution and one suggestion was to use <MediaElement> but that one is only available in a <product> tag which I guess I cannot use in my situation, because the bundle that I am cooking has a custom bootstrapper embedded, and as far as I understood wix product template is not about bootstrapper applications. Another opinion that I found was that you can't create WiX bundle with size of single package more than 2GBs, but that is not exactly my case, because each package I am bundling is no more than 700MBs.

I have already tried separating <MsiPackage>s into <PackageGroup>'s in separate <Fragment>'s which was referenced in <Bundle>'s <chain> in <PackageGroupRef>, but it didn't help, light.exe throws the same error. I have also found a suggestion to try to put packages into separate <Container>s in <bundle>, but I didn't manage to try it because I didn't understand how to do it, WiX bundle documentation just mentions that the are some containers but never actually gave an advice on how to use them.

I am using WiX 3.11

UPD: I just wanted to add some clarifications. My goal is to make a bundle what would be a single .exe file with all related .cab's and other stuff embedded into the final bundle, so delivering bundle that consist of .exe bootstrapper and multiple external .cab file isn't really a preferred option even though it might be x times faster unless this is the only solution in my case.

UPD 2: It seems that yet you can assemble a bundle with 2 GBs + size, it won't start. Maybe because the output executable is x86, and windows can't launch x86 executables over 2gbs size. I didn't manage to make an x64 bundle, maybe that would work, but I never found how to do it. Guess the only option is to let users download missing content and make bundle only contain essential parts. Thanks everyone for help.

Allen K
  • 29
  • 1
  • 3
  • Added a sample for the Containers, but when I got a chance to run it properly there were some issues with launching the embedded setups. Will have a look tomorrow. It did work to compile a setup over 2GB though. – Stein Åsmul Mar 23 '19 at 05:12
  • Did you read the **"Go Online"** segment of my answer and check the links? Often it is possible to slim setups down dramatically by putting stuff online. Well, at least sometimes. That also yields more maintainable files, and obviously opens up for the application not being able to operate if the server files are ever removed. – Stein Åsmul Mar 26 '19 at 16:12
  • I did. We kind of already have this implemented. This wix bundle I am trying to build already contains an executable that allows users to download and update items that are shipped with bundle, so we can generate the bundle with minimum content and let users to download stuff on their own. But the task was to enable bundle that would contain all the content, which currently exceeds 2gbs cap for WiX. – Allen K Mar 27 '19 at 05:10
  • I am not sure how much it matters, but there is the high compression setting for CABs in MSI files: ````. It might be the default for all I know. I believe it enforces [LZX compression](https://stackoverflow.com/a/6313772/129130). [Looks like mszip is default](http://wixtoolset.org/documentation/manual/v3/xsd/wix/media.html). For certain MSI files this could amount to quite a bit, for others probably very limited. – Stein Åsmul Mar 28 '19 at 17:40
  • Did you get this resolved? – Stein Åsmul Apr 19 '19 at 11:11

2 Answers2

1

Compressed bundles cannot be bigger than 2GB. Burn supports containers up to 2GB each and only one container can be attached to the bundle .exe itself.

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
  • Are you sure that only one container can be attached to the bundle? In the [documentation](http://wixtoolset.org/documentation/manual/v3/xsd/wix/bundle.html) it says that min amount of containers in bundle is 0 and max is unbounded. – Allen K Mar 24 '19 at 05:22
  • 1
    Bob Arnson is one of the core WiX developers, he probably wrote that documentation :-). If you still want to experiment (validate the problem), I can undelete my answer (for a while) to show you how I got a bundle to compile - using two containers - despite the size being in excess of 2GB. However, this large bundle didn't launch properly so I deleted the answer to not confuse people (expecting a slow launch of the setup.exe for such a large file, I forgot that I hadn't seen it launch successfully before posting - got busy with something else). – Stein Åsmul Mar 24 '19 at 14:54
  • Multiple containers are supported. Only one container can be attached to the bundle. So says the code. – Bob Arnson Mar 24 '19 at 16:19
  • @Bob Arnson, well, that is some bad news for me. Thanks for the insight anyway. – Allen K Mar 25 '19 at 04:56
  • @Stein Åsmul, well I guess I could give it a try with your solution, maybe it will work for me. Thanks. – Allen K Mar 25 '19 at 05:00
  • No, it won't work. I am pretty sure, but I didn't try to set some containers to download - if that is possible? (you use the max 2GB for the bulk of it, and set the rest to download)? Have a look and let me know when I can delete it again. – Stein Åsmul Mar 25 '19 at 12:50
  • Can I have a bundle .exe (e.g. 1.7GB) and a separated .cab file (e.g. 1GB) or your answer means it is not possible? – Chris Mar 18 '20 at 10:51
0

Bob's answer is still correct for v3.

Support for multiple attached containers was recently added in v4 (#6144). That allows a single file bundle to be larger than 2GB. v4 also added support for x64 (and ARM64) bundles, which allows the bundle to be larger than the x86 maximum.

A related open feature request is #6521 where WiX would automatically split payloads across containers so that the user doesn't have to manually create new containers to avoid the cabinet limitations for size or number of files.

Sean Hall
  • 7,629
  • 2
  • 29
  • 44