Tutorial: How to Include and Use .CAB Archives Within MSI Setup Files
Tutorial: How to Include and Use .CAB Archives Within MSI Setup Files
Inno SetupWiX ToolsetInstallShieldMSIX Packaging Tool
Check your inbox and confirm the
subscription
Exclusive Newsletter
Exclusive 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:
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.
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.
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:
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.
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.
If 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.
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:
- CAB Embedding Options in MSI
- Updated installers in WiX Toolset
- Custom Actions In WiX Toolset
- Windows Services with WiX Installer
- Set WiX Installer Version to the Current Build Version
- Remove Files and Folders when Uninstalling with WiX
- How to set a WiX Toolset custom action to run only on uninstall
- How to create non-advertised shortcuts for all users / per machine with WiX Toolset
- How to Remove Files on Uninstall Using WiX Toolset
- How to create major upgrades for MSI packages using WiX Toolset
- How to pass CustomActionData to a CustomAction using WiX
- How to build an installer without a license page using WiX Toolset
- How to create a WiX KeyPath attribute
- How to Create a Desktop Shortcut using WiX Toolset
- How to Use WiX MSI to Update an Installed Application
- How to correctly set the install folder in Wix
- WiX Toolset Visual Studio Extension
- How to create a custom dialog in WiX for user input
- How to create an MSI installer with WiX
- How to use WIX MSI to do a silent install or uninstall of a web app
Get the most from packaging with Advanced Installer
Try the 30-day fully-featured edition absolutely free!
No credit card required
Also read:
- [Updated] 2024 Approved Quick-Fire Methods to Record and Save Your Virtual Gatherings (Windows & Mac)
- [Updated] Plan Ahead Masterful Fb Timelines Using Free Resources
- [Updated] Pro Gopro Filming and Live Sharing Best Practices for Facebook/Periscope for 2024
- 6 Ways to Change Spotify Location On Your Oppo Reno 10 Pro+ 5G | Dr.fone
- Cookiebot-Enhanced: The Ultimate Analytics Powerhouse
- Customer Triumph Stories: Effective AI Adaptation and Management Techniques
- Diving Deep Into Tech Jargon: Understanding OCR and IDP's Key Differences
- Enhance Site Personalization with Advanced Cookiebot Technology
- Enhance Your Marketing Strategy Using Cookiebot Solutions
- The Art of Storytelling Enhanced by AI's Intelligence
- Top 10 Methods for Seamlessly Moving Images From Your iPhone Onto a Mac
- 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.