Tutorial: How to Include and Use .CAB Archives Within MSI Setup Files

Tutorial: How to Include and Use .CAB Archives Within MSI Setup Files

Donald Lv12

Tutorial: How to Include and Use .CAB Archives Within MSI Setup Files

Versus

Inno SetupInno SetupWiX ToolsetWiX ToolsetInstallShieldInstallShieldMSIX Packaging ToolMSIX Packaging Tool

icon subscribe mail

Check your inbox and confirm the
subscription

Exclusive NewsletterExclusive Newsletter

Exclusive NewsletterExclusive Newsletter

Get the latest WiX insights direct to your inbox. Subscribe now!

Disclaimer: This post includes affiliate links

If you click on a link and make a purchase, I may receive a commission at no extra cost to you.

How To Embed CAB Files in MSI

Written by Alex Marin · June 7th, 2021

One of the most asked questions in the industry is related to CAB files and what embedding options these have within the WiX Toolset.

Let’s see how CAB embedding works within WiX Toolset, what differences are there when using different versions and how you can use Advanced Installer to manage your CAB files in your MSI.

How CAB Embedding Works In WiX Toolset

To control CAB embedding within your Wix Toolset project, you will need to use the following option:

Copy

Just set the EmbedCab value to “yes” or “no” according to your needs - and you’re ready to start.

To see how CAB embedding works, let’s create a simple MSI with WiX Toolset.

For this example, we added a single file called “Trace32.exe” in the package.

The code for the WSX file is as follows:

Name=”My First Installer” Version=”1.0.0.0” Manufacturer=”My Company” Language=”1033”>

Copy

Once we have the MSI configured as needed, it’s time to build it:

1. Create a new batch file in the same folder along with the example.wsx file.

2. Save it asmake_msi.bat.

3. Inside the batch file, paste the following code:

“C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe” example.wxs
“C:\Program Files (x86)\WiX Toolset v3.11\bin\light.exe” example.wixobj
@pause

Copy

When everything is ready, execute the make_msi.bat file - this quick build will result in the example.msi that will appear in the folder.

Execute bat file

After executing the .bat file, the CAB file was embedded inside the MSI. If you don’t want the CAB file to be embedded, change the following line within the example.wsx:

Copy

If you change it and run the make_msi.bat again, a CAB archive named “cab1.cab” will be created next to your MSI.

Create cab file

https://techidaily.com

What Are The Differences When Embedding CAB Files In Different WiX Versions?

Before WiX version 3.8, the MediaTemplate element did not exist and CAB files had to be declared independently:

Copy

This method still works after version 3.8, but if you want to use it, the WSX file should use this code:

Name=”My First Installer” Version=”1.0.0.0” Manufacturer=”My Company” Language=”1033”>

Copy

Keep in mind that if you are using a WiX version higher than 3.8, you can’t use MediaTemplate and Media elements at the same time. Either you declare a template which will be used across all the CAB files (as seen in the first example), or you declare each CAB manually and define if it’s embedded or not.

https://techidaily.com

Using Advanced Installer’s GUI to Manage CAB Files Within Your MSIs

Advanced Installer offers multiple options to handle CAB files within your MSI. Watch our tutorial video to see how it works.

NoteIf you want to see a comparison between WiX and Advanced Installer, check our article titled Bundles-WiX vs. Advanced Installer , where we discuss the basics of WiX - such as where to get it, how to install it, and how to create a bundle of two MSI applications with it.

https://techidaily.com

I hope you found this information helpful and easy to implement.

Advanced Installer #1 alternative to the WiX Toolset

We decided to focus on our main goal to save precious time of our developers.

HANS-LEO TEULINGS
PHD – CEO, NEUROSCRIPT, LLC

You might find useful:

Get the most from packaging with Advanced Installer

Try the 30-day fully-featured edition absolutely free!

Download Free Trial

No credit card required

Also read:

  • Title: Tutorial: How to Include and Use .CAB Archives Within MSI Setup Files
  • Author: Donald
  • Created at : 2024-09-26 16:00:05
  • Updated at : 2024-10-03 19:30:59
  • Link: https://some-tips.techidaily.com/tutorial-how-to-include-and-use-cab-archives-within-msi-setup-files/
  • License: This work is licensed under CC BY-NC-SA 4.0.