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:

  1. Install Cabriolet

  2. Quick Start (5 minutes)

  3. Create Your First Archive

  4. Learn Basic Operations

  5. Explore Advanced Features

Documentation Sections

Getting Started

New to Cabriolet? Start here for installation and basic usage:

Reference

Complete technical reference for CLI and API:

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

Extracting a CAB file
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)"
end
Command-line interface

For 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.txt

Getting help