Quick start guide
Purpose
This 5-minute guide gets you extracting archive files immediately. You’ll learn the essential commands to work with Microsoft Cabinet and other compression formats.
Concepts
Cabriolet provides unified commands that work with all supported archive formats through automatic format detection. The same commands work for CAB, CHM, SZDD, KWAJ, HLP, LIT, and OAB files without needing to specify the format manually.
Cabriolet makes working with these formats simple through both CLI commands and a Ruby API.
Prerequisites
Ensure Cabriolet is installed:
cabriolet --versionIf not installed, see Installation Guide.
Step 1: Get a Sample CAB File
For this tutorial, you can use any CAB file. Common locations:
-
Windows:
C:\Windows\System32\(many.cabfiles) -
Downloaded software installers
-
Windows update packages
Or download a sample from the Cabriolet test fixtures.
Step 2: List CAB Contents
View what’s inside a CAB file without extracting:
cabriolet list archive.cabFiles in archive.cab:
readme.txt (1,245 bytes)
setup.exe (524,288 bytes)
config.ini (512 bytes)
Total: 3 files, 526,045 bytes
Compression: MSZIPThis shows:
-
File names in the archive
-
Uncompressed file sizes
-
Compression method used
Step 3: Extract All Files
Extract everything to the current directory:
cabriolet extract archive.cabOr specify an output directory:
cabriolet extract archive.cab output/Extracting archive.cab...
readme.txt (1,245 bytes) ✓
setup.exe (524,288 bytes) ✓
config.ini (512 bytes) ✓
Successfully extracted 3 files to output/Step 4: Get Archive Information
View detailed information about the CAB file:
cabriolet info archive.cabCabinet: archive.cab
Set ID: 12345
Cabinet number: 1
Total size: 320,512 bytes
Folders: 1
Folder 1:
Compression: MSZIP
Data offset: 36
Data size: 320,476 bytes
Files: 3
readme.txt
Size: 1,245 bytes
Folder: 1
Offset: 0
Attributes: Archive
setup.exe
Size: 524,288 bytes
Folder: 1
Offset: 1,245
Attributes: Archive
config.ini
Size: 512 bytes
Folder: 1
Offset: 525,533
Attributes: ArchiveStep 5: Test Archive Integrity
Verify the archive is not corrupted:
cabriolet test archive.cabTesting archive.cab...
readme.txt ✓
setup.exe ✓
config.ini ✓
All 3 files OKCommon Operations
Extract Specific Files
Extract only certain files (not yet implemented):
# This feature is coming soon
# cabriolet extract archive.cab readme.txt setup.exeFor now, extract all and select needed files from output directory.
Using the Ruby API
The same operations in Ruby code:
require 'cabriolet'
Cabriolet::CAB::Decompressor.new('archive.cab').each_file do |file|
puts "#{file.name} (#{file.size} bytes)"
endrequire 'cabriolet'
decompressor = Cabriolet::CAB::Decompressor.new('archive.cab')
decompressor.extract('output/')require 'cabriolet'
decompressor = Cabriolet::CAB::Decompressor.new('archive.cab')
cabinet = decompressor.cabinet
puts "Files: #{cabinet.files.count}"
puts "Folders: #{cabinet.folders.count}"
cabinet.files.each do |file|
puts " #{file.name} (#{file.size} bytes)"
endFor complete API documentation, see API Reference.
Troubleshooting
Next steps
Now that you can extract CAB files:
-
Learn to create your own CAB files
-
Explore other formats (CHM, SZDD, etc.)
-
Review compression algorithms to understand MSZIP, LZX, and more
-
Check the CLI reference