MSI Format
Concepts
MSI (Microsoft Installer) files are OLE compound documents containing Windows Installer databases and embedded CAB archives with the actual files to install.
MSI Structure
MSI files are OLE compound documents containing:
installer.msi
├── Binary/ # Custom action DLLs
├── Data/ # CAB archives (data1.cab, data2.cab, etc.)
├── Tables/ # MSI database tables
└── Streams/ # Embedded files and streamsWhen to Use Recursive
Use recursive_packages: true to extract file contents:
# Without recursive - you get CAB files
Excavate::Archive.new('setup.msi').extract
# Result: setup/data1.cab, setup/data2.cab
# With recursive - you get actual files
Excavate::Archive.new('setup.msi').extract(recursive_packages: true)
# Result: setup/file1.dll, setup/file2.exe, etc.Extracting Specific Content
File Sanitization
Excavate sanitizes filenames from MSI files:
-
Path separators are removed
-
Non-ASCII characters are handled
-
CAB files are renamed with
.cabextension
Common Use Cases
CLI Usage
# Extract MSI recursively
excavate -r installer.msi
# Extract with filter
excavate -r --filter "**/*.dll" installer.msiTechnical Details
Excavate uses the Omnizip gem’s OLE support:
-
Extracts OLE compound document structure
-
Identifies embedded CAB files
-
Renames detected CABs with
.cabextension -
Passes CABs to recursive extraction
Related Topics
-
CAB Format - Files embedded in MSI