Cabinet (file format)
| Filename extension | .cab |
|---|---|
| Internet media type | application/vnd.ms-cab-compressed |
| Uniform Type Identifier | public.archive.cab |
| UTI conforms to | public.data public.archive |
| Magic number | MSCF |
| Developed by | Microsoft |
| Type of format | Archive file format |
Cabinet (or CAB) is an archive file format for Microsoft Windows that supports lossless data compression and embedded digital certificates used for maintaining archive integrity. Cabinet files have .cab file name extensions and are recognized by their first 4 bytes MSCF. Cabinet files were known originally as Diamond files.
The CAB file format may employ the following compression algorithms:
- DEFLATE – invented by Phil Katz, the author of the ZIP file format
- Quantum compression – licensed from David Stafford, the author of the Quantum archiver
- LZX – invented by Jonathan Forbes and Tomi Poutanen, given to Microsoft when Forbes joined the company
A CAB archive can reserve empty spaces in the archive as well as for each file in the archive, for some application-specific uses like digital signatures or arbitrary data. CAB format is used by a variety of Microsoft installation technologies including Windows Installer, Setup API, Device Installer and AdvPack (used by Internet Explorer to install ActiveX components). CAB files are also often associated with self-extracting programs where the executable program extracts the associated CAB file. CAB files are also sometimes embedded into other files. For example, MSI files usually included one or more embedded CAB files.
Contents |
File structure [edit]
A CAB archive can contain up to 65535 CAB-folders, (not to be confused with file system folders,) each can contain up to 65535 files. A CAB-folder is a nameless collection of files each with its own path.[1] Due to this structure, it is not possible to store empty folders in CAB archives.
The following shows an example a CAB file structure, demonstrating the relationship between CAB-folders and files:
| CAB file | ||
1st CAB-folder
|
||
2nd CAB-folder
|
How paths should be handled is not specified in the CAB file format, leaving it to the software implementation.
- Some affix file paths to filenames only, as if all files in a CAB archive are in a single folder. IExpress works this way, so is Microsoft Windows Explorer, which can open CAB archives as a folder.
- Some can store the paths, and upon extraction, create folders as necessary. CABARC.EXE and EXTRACT.EXE (tools from Microsoft Cabinet SDK[2] ) as well as
lcab[3] andcabextract[4] (third-party open-source tools) work this way. - EXPAND.EXE, which is included in many versions of Windows, can extract files to their paths, but won't create the directories as needed. It produces an error when the directories are not already there.
Software [edit]
Software that can extract the contents of a Cabinet file are numerous, including Microsoft Windows itself (through File Explorer, expand.exe or extract.exe) as well as well-known software such as WinZip, WinRAR or 7-Zip. However, fewer programs can create Cabinet files. For a full list, see Comparison of file archivers § archive formats.
Related formats [edit]
The .cab filename extension is also used by other installer programs (e.g. InstallShield) for their own proprietary archiving formats. InstallShield uses zlib for compression (see Deflate), but their headers are not the same as for Microsoft CAB files so they are incompatible and cannot be manipulated or edited with the programs that are made for standard Cabinet format. Specialized third-party utilities, such as Unshield,[5] can extract this specific proprietary format.
Microsoft Publisher has a "Pack and Go" feature that bundles a publisher document, together with all external links, into a CAB file with a .PUZ extension. These files are meant to be activated with a companion .EXE file which is distributed along with the .PUZ file. These files may be renamed and activated with any CAB file extraction program.
See also [edit]
References [edit]
- ^ http://msdn2.microsoft.com/en-us/library/bb267310.aspx Microsoft Cabinet Format
- ^ "Microsoft Cabinet Software Development Kit". Support. Microsoft. Retrieved 27 March 2013.
- ^ "lcab". Freecode. Dice. Retrieved 27 March 2013.
- ^ "cabextract". Freecode. Dice. Retrieved 27 March 2013.
- ^ Unshield
External links [edit]
- Microsoft Cabinet SDK - updated versions of these resources are available in the Microsoft Windows SDK
- Expand Command Reference - Windows XP Professional Product Documentation
- Cabinet Software Development Kit (CAB SDK) - downloads of all Microsoft CAB SDK versions (free)
- Diamond: A Compression and Disk Layout Tool - Microsoft documentation (saved)
- [1] is an opensource program to create no-compression cab files.
- CabPack is a freeware compression program which can create cabinet files. (Last update: 28 November 2001)
- cabextract is Free Software for unpacking cabinet files in UNIX
- libmspack is an LGPL licensed, portable library for creating and extracting CAB files and other Microsoft misc. formats (creation of CAB files not implemented yet)
- LCAB - Linux cabinet file creator
- Unshield - InstallShield CAB extraction utility for UNIXs
|
||||||||||||||||||||