Cabriolet: working with Microsoft archive formats in Ruby
Purpose
Cabriolet is a pure Ruby implementation for Microsoft compression formats, providing comprehensive support for CAB, CHM, SZDD, KWAJ, HLP, LIT, and OAB file formats with multiple compression algorithms.
Documentation Map
New to Cabriolet?
Follow this learning path:
-
Install Cabriolet
-
Quick Start (5 minutes)
-
Create Your First Archive
-
Learn Basic Operations
-
Explore Advanced Features
Looking for Something Specific?
Working with Files
File Formats
Compression Algorithms
Advanced Topics
Reference Materials
For Developers
Help & Resources
Documentation Sections
Supported formats
Cabriolet supports 7 Microsoft compression formats:
| Format | Description | Common Use |
|---|---|---|
CAB | Microsoft Cabinet files | Software distribution, Windows installers |
CHM | Compiled HTML Help | Windows help files, documentation |
SZDD | Single-file LZSS compression | Compressed system files (*.ex_, *.dl_) |
KWAJ | KWAJ compression format | Compressed installers |
HLP | Windows Help files | Legacy Windows help system |
LIT | Microsoft Reader eBooks | Digital book format |
OAB | Offline Address Book | Exchange/Outlook data files |
Compression Algorithms
Five compression algorithms supported:
-
None - Uncompressed storage
-
LZSS - Simple dictionary compression
-
MSZIP - Deflate-based compression (ZIP-compatible)
-
LZX - High compression ratio
-
Quantum - Memory-efficient compression
Key Features
-
Pure Ruby - No native dependencies, works on any Ruby platform
-
Format Detection - Automatic format identification
-
Multi-part Support - Handle split CAB archives
-
Embedded CABs - Extract cabinets from executables
-
Salvage Mode - Recover data from damaged archives
-
Custom I/O - File or memory-based operations
-
CLI Tools - Complete command-line interface
-
Ruby API - Full programmatic access
Example Usage
require 'cabriolet'
# Extract all files
Cabriolet::CAB::Decompressor.new('archive.cab').extract('output/')
# List contents
Cabriolet::CAB::Decompressor.new('archive.cab').each_file do |file|
puts "#{file.name} (#{file.size} bytes)"
endFor extraction and listing, formats are auto-detected from the file. For creation, the format is determined by the output file extension or --format option:
# Extract/list - auto-detects format from input file
cabriolet extract archive.cab output/
cabriolet list help.chm
# Create - format determined by output extension
cabriolet create archive.cab file1.txt file2.txt
cabriolet create help.chm index.html style.css
cabriolet create compressed.ex_ program.exe # SZDD format
# Create with explicit format (overrides extension)
cabriolet create --format szdd output.tx_ input.txt
cabriolet create --format chm output.chm *.html
# Test archive integrity
cabriolet test archive.cab
# Force format for extraction (rarely needed)
cabriolet extract --format szdd file.dat output.txtGetting help
-
Documentation: Browse the guides and reference sections
-
Issues: Report bugs at https://github.com/omnizip/cabriolet/issues
-
Source: View the code at https://github.com/omnizip/cabriolet