Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Cabinet (file format)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Archive file format created for Microsoft Windows}} {{Original research|date=October 2020}} {{Use dmy dates|date=February 2023}} {{ infobox file format | name = Cabinet | icon = Cab file format icon.png | extension = .cab | mime = application/vnd.ms-cab-compressed | uniform type = public.archive.cab | conforms to = public.data<br />public.archive | owner = [[Microsoft]] | creatorcode = | magic = MSCF | genre = [[Archive file format]] | containerfor = | containedby = | extendedfrom = | extendedto = }} '''Cabinet''' (or '''CAB''') is an [[archive file format|archive-file format]] for [[Microsoft Windows]] that supports [[lossless data compression]] and embedded [[digital certificate]]s used for maintaining archive integrity. Cabinet files have <code>.cab</code> [[filename extension]]s and are recognized by their first four bytes (also called their ''[[File format#Magic number|magic number]]'') ''MSCF''. Cabinet files were known originally as Diamond files. == Design == A CAB archive can contain up to 65,535 ''folders'' (distinct from standard operating system directories), each of which can contain up to 65,535 files for a maximum of 4,294,836,225. Internally, each folder is treated as a [[solid compression|single compressed block]], which provides more efficient compression than individually compressing each file. Every entry in a folder has to be a file.<ref name="msdn.microsoft.com">[https://msdn.microsoft.com/en-us/library/bb267310.aspx Microsoft Cabinet Format]</ref> 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 folders and files: {{tree list}} * CAB file ** First folder *** {{samp|Records/Student_01[[.tsv]]}} *** {{samp|Records/Photos/Student_01[[.jpg]]}} ** Second folder *** {{samp|Records/Student_02.tsv}} *** {{samp|Records/Photos/Student_02.jpg}} {{tree list/end}} 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, as does Microsoft Windows Explorer, which can open CAB archives as a folder. * Some can store the paths, and upon extraction, create folders as necessary. {{mono|CABARC.EXE}} and {{mono|EXTRACT.EXE}} (tools from Microsoft Cabinet SDK<ref>{{cite web|title=Microsoft Cabinet Software Development Kit|url=https://support.microsoft.com/kb/310618|work=Support|publisher=Microsoft|access-date=27 March 2013}}</ref>) as well as {{samp|lcab}}<ref>{{cite web|title=lcab|url=http://freecode.com/projects/lcab|work=Freecode|publisher=Dice|access-date=27 March 2013}}</ref> and {{samp|cabextract}}<ref>{{cite web|title=cabextract|url=https://www.cabextract.org.uk/}}</ref> (third-party [[open-source software|open-source]] tools) work this way. * {{mono|EXPAND.EXE}}, only since version 6 (which is included from Windows Vista to above) can extract files to their paths. The previous versions don't do it.<ref>{{cite web|url=http://ss64.org/viewtopic.php?id=1816|title=[Undocumented] [Bugs] Expand.exe (more about it) (Page 1) / Windows CMD Shell / SS64 Forum|website=ss64.org|access-date=21 April 2018}}</ref> The CAB file format may employ the following [[compression algorithm]]s: * [[DEFLATE]]: invented by [[Phil Katz]], the author of the [[ZIP file format]] (specifically, the MSZIP encapsulation)<ref>{{cite web |title=[MS-MCI]: Microsoft ZIP (MSZIP) Compression and Decompression Data Structure |url=https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-mci/ |website=docs.microsoft.com |date=13 October 2020 |language=en-us}}</ref> * Quantum compression: licensed from David Stafford,<ref>{{Cite book|last=Salomon|first=D. (David)|url=https://archive.org/details/datacompressionc00salo_251/page/n206/mode/2up|title=Data compression : the complete reference|date=2007|publisher=London : Springer|others=Library Genesis|isbn=978-1-84628-602-5|pages=187}}</ref>{{dead|date=October 2023}} the author of the Quantum archiver (not available in all versions of makecab.exe/diamond.exe)<ref>{{cite web |title=Quantum compression format |url=http://www.russotto.net/quantumcomp.html |website=Matthew Russotto |access-date=29 March 2022 |archive-date=11 May 2021 |archive-url=https://web.archive.org/web/20210511035452/http://www.russotto.net/quantumcomp.html |url-status=dead }}</ref><ref>{{Cite web |date=2011-03-04 |title=Cabinet File Format β Open Specifications Documentation |url=https://download.microsoft.com/download/4/d/a/4da14f27-b4ef-4170-a6e6-5b1ef85b1baa/[ms-cab].pdf#page=9 |url-status=live |archive-url=https://web.archive.org/web/20161118224049/https://download.microsoft.com/download/4/d/a/4da14f27-b4ef-4170-a6e6-5b1ef85b1baa/[ms-cab].pdf |archive-date=2016-11-18 |archive-format=PDF |access-date=2023-02-15 |publisher=Microsoft Corporation}}</ref> * [[LZX]]: invented by [[Jonathan Forbes (programmer)|Jonathan Forbes]] and Tomi Poutanen, given to Microsoft when Forbes joined the company * NULL: stored 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. == Implementations == {{Main|Comparison of file archivers}} [[Microsoft Windows]] supports creating CAB archive files using the <code>makecab</code> [[command-line interface|command-line]] utility. It supports extracting the contents of a CAB archive files using [[File Explorer]], [[Setup API]], and using the command-line [[command (computing)|commands]] <code>expand.exe</code>,<ref name="ss64-expand">[https://ss64.com/nt/expand.html expand β Windows CMD β SS64.com]</ref> <code>extract.exe</code> and <code>extrac32.exe</code>.<ref>[https://www.thewindowsclub.com/extract-cab-file-using-command-line How to extract CAB File using command line tools in Windows 10]</ref><ref name="ss64-extract">[https://ss64.com/nt/extract.html Extrac32 β Uncompress files β Windows CMD β SS64.com]</ref> Other well-known software with CAB archive support includes [[WinZip]], [[WinRAR]] or [[7-Zip]]. The aforementioned <code>cabextract</code> is a common tool for Linux systems,<ref>[https://www.systranbox.com/how-to-extract-cab-files-in-linux/ How to extract CAB files in Linux]{{Dead link|date=August 2023 |bot=InternetArchiveBot |fix-attempted=yes }}</ref> but is only capable of extracting archives. The <code>gcab</code> tool however can both extract and create CAB archives.<ref>[https://gitlab.gnome.org/GNOME/gcab gcab project on GNOME]</ref> For a full list, see {{section link|Comparison of file archivers|archive formats}}. == Uses == A variety of [[Microsoft]] installation technologies use the CAB format: these include [[Windows Installer]], [[Windows Setup]] (from [[Windows 95]] to [[Windows Server 2003]]), [[Setup API]], [[Device Installer]], [[Features new to Windows 7#Themes|Theme Pack]] and [[AdvPack]] (used by [[Internet Explorer]] to install [[ActiveX]] components). CAB files are also often associated with self-extracting programs like [[IExpress]] where the executable program extracts the associated CAB file. CAB files are also sometimes embedded into other files. For example, [[Windows Installer|MSI and MSU]] files usually include one or more embedded CAB files. Windows uses the cabinet format to archive its [[Management features new to Windows Vista#Component Based Servicing|Component-Based Servicing]] (CBS) log, which is kept in the folder {{mono|C:\Windows\Logs\CBS}}. A bug in the compression process can cause run-away generation of useless log files both in that folder and in {{mono|C:\Windows\Temp}}, which can consume disk storage until completely filling the hard drive.<ref>{{Cite web|url=https://social.technet.microsoft.com/wiki/contents/articles/38259.clean-up-component-based-servicing-logs.aspx|title=Clean Up Component-Based Servicing logs|date=7 July 2017|website=Microsoft TechNet}}</ref><ref name=":0">{{Cite web|url=https://www.computerworld.com/article/3112358/microsoft-windows/windows-7-log-file-compression-bug-can-fill-up-your-hard-drive.html|title=Windows 7 log file compression bug can fill up your hard drive|last=Leonhard|first=Woody|date=2016-08-25|website=Computerworld|language=en|access-date=2019-01-08|archive-date=8 January 2019|archive-url=https://web.archive.org/web/20190108145549/https://www.computerworld.com/article/3112358/microsoft-windows/windows-7-log-file-compression-bug-can-fill-up-your-hard-drive.html|url-status=dead}}</ref> Deletion of the files without following a specific procedure<ref name=":0" /> can cause the deleted files to be regenerated at an increased pace. On [[Linux]] systems, CAB archives are used by [[fwupd]] to distribute [[firmware]] updates from hardware vendors<ref>{{cite web |title=LVFS: Hardware Vendors |url=https://fwupd.org/lvfs/docs/vendors |website=Linux Vendor Firmware Service Project |access-date=3 May 2022}}</ref> that can be flashed on [[non-volatile memory]]. == Related formats == The <code>.cab</code> 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, can extract this specific proprietary format.<ref>{{cite web|url=https://github.com/twogood/unshield|title=twogood/unshield|website=GitHub|access-date=21 April 2018}}</ref> This format has a different magic number of {{tt|ISC(}}.<ref name=magic>{{cite web |title=kyz/libmspack: doc/magic |url=https://github.com/kyz/libmspack/blob/master/cabextract/doc/magic |website=GitHub |date=2 January 2022 |language=en}}</ref> [[Windows CE]] software is distributed as CAB files where the first file inside, ending with extension ".000", details how it is installed.<ref>{{cite web |title=Windows CE installation cabinet (.CAB) file format |url=https://www.cabextract.org.uk/wince_cab_format/ |website=cabextract}}</ref> [[Microsoft Installer]] <code>.msi</code> files sometimes ''contain'' CAB files, but are themselves in the [[Compound File Binary Format]] which has to be decoded first. Software like <code>lessmsi</code> can be used to unpack these files. Microsoft Publisher has a "Pack and Go" feature that bundles a publisher document, together with all external links, into a CAB file with a <code>.PUZ</code> extension. These files are meant to be activated with a companion .EXE file which is distributed along with the <code>.PUZ</code> file. These files may be opened with any CAB file extraction program. == See also == * [[List of archive formats]] == References == {{reflist}} == External links == {{Wikibooks|Guide to Windows Commands}} * [https://msdn.microsoft.com/en-us/library/ms974336.aspx Microsoft Cabinet SDK] β updated versions of these resources are available in the [[Microsoft Windows SDK]] * [http://www.mdgx.com/add.htm#CAB Cabinet Software Development Kit (CAB SDK)] β downloads of all Microsoft CAB SDK versions (free) {{Archive formats}} {{Windows commands}} [[Category:Archive formats]] [[Category:Windows administration]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Ambox
(
edit
)
Template:Archive formats
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Dead
(
edit
)
Template:Dead link
(
edit
)
Template:Infobox file format
(
edit
)
Template:Main
(
edit
)
Template:Mono
(
edit
)
Template:Original research
(
edit
)
Template:Reflist
(
edit
)
Template:Samp
(
edit
)
Template:Section link
(
edit
)
Template:Short description
(
edit
)
Template:Sister project
(
edit
)
Template:Tree list
(
edit
)
Template:Tree list/end
(
edit
)
Template:Tt
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Wikibooks
(
edit
)
Template:Windows commands
(
edit
)