Cabinet (file format)
Cabinet (CAB) is an archive-file format for Microsoft Windows that supports lossless data compression and embedded digital certificates for archive integrity. Cabinet files are identified by the .cab filename extension and the magic number MSCF in their first four bytes. Originally known as Diamond files, the format is notable for its use in various Microsoft installation technologies.
Quick Facts
- Extension
- .cab
- Mime
- application/vnd.ms-cab-compressed
- Uniform type
- public.archive.cab
- Conforms to
- public.data; public.archive
- Owner
- Microsoft
- Magic
- MSCF
- Genre
- Archive file format
Facts from the source article.
Design
A CAB archive can contain up to 65,535 folders, each of which can hold up to 65,535 files, for a maximum of 4,294,836,225 files. Internally, each folder is treated as a single compressed block, providing more efficient compression than compressing each file individually. Every entry in a folder must be a file, so empty folders cannot be stored. The format does not specify how paths should be handled, leaving it to the software implementation: some affix file paths to filenames only, as if all files are in a single folder (as IExpress and Windows Explorer do), while others can store paths and create folders upon extraction (as tools from the Microsoft Cabinet SDK and third-party tools like cabextract and gcab do).
The expand command, only since version 6 (included from Windows Vista onward), can extract files to their paths; earlier versions do not. The CAB format may employ DEFLATE (specifically the MSZIP encapsulation), Quantum compression (licensed from David Stafford), LZX (invented by Jonathan Forbes and Tomi Poutanen), or NULL (stored). A CAB archive can reserve empty spaces in the archive and for each file for application-specific uses such as digital signatures or arbitrary data.
Implementations
If you are on Windows, you can create CAB archives with the makecab command. To open them, use File Explorer, the Setup API, or commands like expand.exe, extract.exe, or extrac32.exe. Popular third-party tools like WinZip, WinRAR, and 7-Zip also support CAB files. On Linux, cabextract can only open these archives, while gcab can both open and create them.
Uses
A variety of Microsoft installation technologies use the CAB format, including Windows Installer, Windows Setup (from Windows 95 to Windows Server 2003), Setup API, Device Installer, Theme Pack, and AdvPack (used by Internet Explorer to install ActiveX components). CAB files are often associated with self-extracting programs like IExpress. They are also embedded into other files such as MSI and MSU files. Windows uses the cabinet format to archive its Component-Based Servicing (CBS) log; a bug in the compression process can cause runaway generation of useless log files that can fill the hard drive. On Linux systems, CAB archives are used by fwupd to distribute firmware updates.
Related formats
The .cab filename extension is also used by other installer programs such as InstallShield for their own proprietary archiving formats. InstallShield uses zlib for compression, but their headers differ from Microsoft CAB files, making them incompatible; specialized utilities like Unshield can extract this format. Windows CE and Windows Mobile software is distributed as CAB files where the first file inside, ending with .000, details installation. Microsoft Installer .msi files sometimes contain CAB files but are in the Compound File Binary Format, which must be decoded first; software like lessmsi can unpack them. Microsoft Publisher's 'Pack and Go' feature bundles a document and external links into a CAB file with a .PUZ extension, meant to be activated with a companion .EXE file.
More in Windows Administration
Spotted an error? Know more?
Reader corrections go straight into our review queue. Suggest an edit · How this site is sourced