Total MSI File size exceeding 2GB

Jan 17, 2017 at 10:41 AM

My total file size within an Wix# project including data exceeds 2GB and currently I am unable to create Setup. Read in Wix documentation that multiple cab will solve the issue. How can I do that in Wx#
Jan 18, 2017 at 12:39 PM
You can add as many Media elements as you need with XML post-processing:
project.WixSourceGenerated += Compiler_WixSourceGenerated;
static void Compiler_WixSourceGenerated(XDocument document)
            .AddElement("Media", "Id=1;; EmbedCab=no")
            .AddElement("Media", "Id=2;; EmbedCab=no")
            .AddElement("Media", "Id=3;; EmbedCab=no");
And when you add a file you can always pass the desired media id:
new File(@"Files\Bin\MyApp.exe") { AttributesDefinition = "DiskId=2" }
But I cannot say I like this solution. The MediaTemplate element is much more elegant approach as it (with a single element) defines the splitting algorithm without explicit mapping cabs and files.

Approach is the same:
document.Root.Select("Product/Media").Remove(); //don't need it any more
             .AddElement("MediaTemplate", "MaximumCabinetSizeForLargeFileSplitting=2048");
You can even drop the MaximumCabinetSizeForLargeFileSplitting=2048 as it is a default value anyway.

I think it is a good feature to go to default features set. Please log the feature request on GitHub and I will implement it as something like this:
project.MediaTemplate = new MediaTemplate{MaximumCabinetSizeForLargeFileSplitting=2048};
project.Cabs = MediaTemplate.Default; 
Please use GitHub for any further discussions: