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 --version

If 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 .cab files)

  • 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.cab
Example Output
Files in archive.cab:
  readme.txt (1,245 bytes)
  setup.exe (524,288 bytes)
  config.ini (512 bytes)

Total: 3 files, 526,045 bytes
Compression: MSZIP

This 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.cab

Or specify an output directory:

cabriolet extract archive.cab output/
Example 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.cab
Example Output
Cabinet: 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: Archive

Step 5: Test Archive Integrity

Verify the archive is not corrupted:

cabriolet test archive.cab
Example Output
Testing archive.cab...
  readme.txt ✓
  setup.exe ✓
  config.ini ✓

All 3 files OK

Common Operations

Extract Specific Files

Extract only certain files (not yet implemented):

# This feature is coming soon
# cabriolet extract archive.cab readme.txt setup.exe

For now, extract all and select needed files from output directory.

Search for Embedded CABs

Some executables contain embedded CAB files. Search for them:

cabriolet search installer.exe
Example Output
Found embedded CAB at offset 245,760 (size: 1,024,000 bytes)
Found embedded CAB at offset 1,269,760 (size: 512,000 bytes)

Total: 2 embedded CAB files found

Verbose output

Get detailed progress information:

cabriolet --verbose extract archive.cab

This shows:

  • Decompression progress

  • Individual file extraction

  • Any warnings or issues

Using the Ruby API

The same operations in Ruby code:

List files
require 'cabriolet'

Cabriolet::CAB::Decompressor.new('archive.cab').each_file do |file|
  puts "#{file.name} (#{file.size} bytes)"
end
Extract files
require 'cabriolet'

decompressor = Cabriolet::CAB::Decompressor.new('archive.cab')
decompressor.extract('output/')
Get archive info
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)"
end

For complete API documentation, see API Reference.

Troubleshooting

"Cannot open file" Error

Ensure the file path is correct and the file exists:

ls -l archive.cab

"Invalid CAB signature" Error

The file may not be a valid CAB file, or it could be corrupted. Try:

file archive.cab

This should show Microsoft Cabinet archive data.

Extraction Fails

If extraction fails, try verbose mode to see details:

cabriolet --verbose extract archive.cab

Check for:

  • Sufficient disk space

  • Write permissions in output directory

  • Corrupted archive (test with cabriolet test)

Next steps

Now that you can extract CAB files: