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. Every field, flag and code is on the structures and codes page.
Not described
Re-checked on 2026-11-13 against the Cabinet SDK document (including its LZX chapter),
Wine’s fdi.h and libmspack’s cab.h, cabd.c, lzxd.c and
mszipd.c.
Known, not yet covered
- Reference: the Huffman table-building rules and the bit-exact tree decoding of LZX beyond the structure on the LZX section, and Microsoft’s separate MSZIP document (the Deflate format itself is RFC 1951).
- Reference: the Quantum method, which libmspack implements (
qtmd.c) but which is not in Microsoft’s documents; and the LZX DELTA variant, which uses the same structure with larger windows and a longer-match extension. - Reference: where a code signature sits in a signed cabinet (the SDK only says space is reserved) and the other cabinet-set details of the SDK’s tools.
Links
Software
- File Explorer – opens cabinets like folders, with the
expandandmakecabcommands (Windows) - 7-Zip – free archiver that extracts cabinets (Windows)
- cabextract – free command-line extractor (Linux, macOS)
- The Unarchiver – free extractor for many formats (macOS)
Developers
- libmspack – library for cabinets and other Microsoft compression formats (C)
- libarchive – reads cabinets among many formats (C)
Reference
- [MS-CAB]: Cabinet File Format – Microsoft’s published specification, in its Open Specifications
- Microsoft Cabinet SDK documentation – the cabinet format, MSZIP, Quantum notes and LZX, from Microsoft’s archived SDK