Introduction
Cabinet is Microsoft’s archive format for installing software. It has been used since
the mid-1990s for Windows setup files, drivers, updates and Office installers, and
Windows Installer packages often carry their files in cabinets. A set of cabinets can be
chained so one install spans several files or disks. Windows opens .cab
files like folders, and its expand and makecab commands
unpack and build them. Microsoft publishes the format as [MS-CAB].
Structure
Files are grouped into folders, each compressed as one stream, so small files in the same folder compress well together. Numbers are little-endian.
0HeaderMSCF, cabinet size, offset of the first file entry, version 1.3, folder and file counts, flags, set ID and number in the set36 bytes or more…Folder entries offset of the first data block, block count, compression type8 bytes each…File entries size, offset in the uncompressed folder, folder index, date, time, attributes, name16 bytes + name each…Data blocks checksum, compressed and uncompressed size, dataup to 32 KB uncompressed each
The compression type is none, MSZIP (DEFLATE in 32 KB blocks), Quantum or LZX. Header flags say whether the cabinet continues from a previous one or into a next one, and whether optional reserved areas are present for signing.
Links
Software
- File Explorer, with the
expandandmakecabcommands, built into Windows - 7-Zip (Windows)
- cabextract (Linux, macOS)
- The Unarchiver (macOS)
Developers
- libmspack, C library for cabinets and other Microsoft compression formats
- libarchive, C library that reads cabinets
Reference
- [MS-CAB]: Cabinet File Format, Microsoft Open Specifications