![]() Cabinet File (*. CAB) Compression and Extraction. Introduction. With this project, C++ and . NET programmers get a very versatile library for compression and extraction of Microsoft CAB files. NET 1. 1 does not offer compression functionality. NET 2. 0 offers the System. ![]() ![]() IO. Compression. GZip. Stream class. But this is awkward to use and very primitive; it can only compress a stream but it is not possible to compress folders containing files and subfolders. If you search the internet for more comfortable compression libraries, you find, for example, ICSharp. Code. Sharp. Zip. Lib. dll which offers ZIP compression. But this library is awkward to use and buggy, and so is unusable. Although the bugs have been known for years, the author has not fixed them. I asked myself why should I search for another open source library (which will again have other bugs) while Windows itself supports CAB archives since the first days? Microsoft Cabinet (CAB) files are widely used in Microsoft Windows operating system, and also on various software installations designed for Windows operating system. These files are compressed using a specific compression. I'll trying to migrate away from Simply Accounting and need to somehow extract the contents of a Windows CAB file which is what Simply uses for backups. What is the best way to open a CAB file on. You May Also Like. How to Install a CAB File. A 'CAB' file is an abbreviation for a cabinet file. Microsoft developed this file type as a compressed installation file. A CAB. How to Install a CAB File With the Command Line. Microsoft's Cabinet. System. 32 directory) is not buggy. Many Microsoft installers (like the installer for Internet Explorer or Windows patches) use it. Additionally, CAB reaches a much better compression ratio than ZIP. Features. This library is VERY easy to use. This library is lightweight and VERY fast. C++ code)This library can be extended very easily. One project is for C++ developers. Another project is for . ![]() 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 filename extensions and. ![]()
NET developers. Both projects compile on Visual Studio 2. The . NET project runs on all platforms where the required . NET framework is installed. Both projects support multithreading. Optional Encryption / Decryption of CAB files. CAB files can contain trees of subfolders and files. File dates (in either UTC or local time) and file attributes are preserved when compressing / extracting. Extraction of CAB files which are embedded in the resources of your Win. NET project. In . NET you can additionally extract CAB files from a stream. The compression can split large CAB files into multiple pieces. Pack. 1. cab, Pack. Pack. 3. cab etc)An event handler allows to display the compression / extraction progress in the GUI of your application. A lot of event handlers are called during compression and extraction which allows to interact with the progress (for example filtering specific files)Both projects come with a demo application which shows how to compress and extract files and embedded CAB resources. Encryption and Decryption is also included in the demo. This project makes use of Microsoft's Cabinet. System(3. 2) directory, which is part of the operating system since Windows NT/9. Cabinet. dll will be loaded only when it is needed and unloaded afterwards. You can also link statically and the external DLL is not required. In the download you find Release versions of Cab. Lib. dll for VS 2. The C++ and the . NET project support Unicode in paths and filenames (e. Japanese) independent if compiled as MBCS or UNICODE. The . NET library is strong named, it can be installed into the GAC with gacutil. Version History. Since version Jan 2. Msvcp. 70/7. 1/8. DLL is not required anymore. Since version Apr 2. CAB files directly from a server, (URL extraction from HTTP(S) / FTP)you can even extract only specific files out of a CAB on a server without downloading the entire CAB file, (partial download)you can also abuse this library to only download a file (MP3, AVI.) from the internet to disk without CAB extraction. Since version May 2. NET library also extracts files with the extensions . URL or . LNK. Since version Jun 2. CAB files uses the Blowfish algorithm. Since version Aug 2. CAB archives without compression is supported. Since version Sep 2. Additionally UTF7 was replaced with UTF8. Since version Oct 2. Bit or 6. 4 Bit version. Since version Jan 2. UTF8 encoding. (See below!)Since version Feb 2. Cabinet. dll statically. See Defines. h)Since version Mar 2. Cab. Lib. dll is strong named. Since version Aug 2. Since version Dec 2. CAB files may be embedded as resources,a bugfix allows to skip files when extracting splitted CAB's,another bugfix corrects the default compression Temp directory,Solution and Release DLL for Visual Studio 2. Since version Feb 2. CAB files, LZX compression added. Since version March 2. Support for extraction of non- standard- conform CAB files. Since version Mrz 2. URL extraction from a HTTPS server. Since version Jan 2. Visual Studio 1. 4 and higher. Microsoft has removed the option /clr: oldsyntax)You can download my Universal Installer (incl sourcecode) which uses the Cab. Lib Library for software setups and updates. This application demonstrates all the available Cab. Lib features like URL extraction, extraction to memory, how to display the progress in a progressbar, etc. Dependencies. Cabinet / Cab. Lib Project. Dependencies. Framework. C++ Redistributable. Cabinet C++ Project - 3. Bit VS 6, 2. 00. 2, 2. Cabinet C++ Project - 6. Bit. VS 2. 00. 5, 2. Cab. Lib . NET Project - 3. Bit. VS 2. 00. 5Ms. Vcr. 80. DLL, Ms. Vcm. 80. DLL (x. 32)2. Download. Cab. Lib . NET Project - 6. 4 Bit. VS 2. 00. 5Ms. Vcr. DLL, Ms. Vcm. 80. DLL (Amd. 64)2. 0. Download. Cab. Lib . NET Project - 3. 2 Bit. VS 2. 01. 0Ms. Vcr. DLL (x. 32)4. X2. Download. Cab. Lib . NET Project - 6. 4 Bit VS 2. Ms. Vcr. 10. 0. DLL (Amd. X2. 01. 0 x. 64 Download. Microsoft removed a VS 2. VS 2. 00. 5: The compiler switch /MT does not work anymore for Managed C++ projects. Error D8. 01. 6)On VS 2. C++ funcions (fopen, fread, flose etc.) statically into Cab. Lib. dll. On VS 2. DLLs MSVCR8. 0/9. DLL and MSVCM8. 0/9. DLL are additionally required. ATTENTION: If these DLL's are not installed on the target machine the user will NOT get an intelligent error message telling him what is wrong. Instead Microsoft . NET throws the most stupid exceptions like: "Cab. Lib. dll or one of its dependencies could not be loaded" or "System. IO. File. Load. Exception.. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem". The users of your application will never suspect that the cause is a missing Ms. Vcr. 80/9. 0. dll! Since VS 2. 00. 5 a manifest file (XML) is automatically generated and compiled into Cab. Lib. dll (RT_MANIFEST) telling on which DLL's it depends. You can see this manifest when you open Cab. Lib. DLL with Resource. Hacker. There are 2 ways to assure that the Ms. Vcr/Ms. Vcm DLLs exist on the target computer: The users of your application must download and install the correct version of the Visual C++ Redistributable Package (see download links in table above). The files will be installed "side by side" as shared assemblies into C: \Windows\Win. Sx. S\Cryptic Folder. Or you install the following files directly into the application folder as private assemblies: Microsoft. VC8. 0. CRT. manifest, msvcr. You find these files in your Visual Studio folder under VC\Redist. The versions of these DLLs must be EXACTLY the same as those in the manifest compiled into Cab. Lib. dll. You can read the following articles in the MSDN: Private Assemblies and Assembly Searching Sequence but probably you will get quite confused. You find a better article on tydbits. Limitations. The maximum size for files that Cabinet. GB. The maximum size of one CAB file is also 2 GB. But you can create splitted CAB files of unlimited size. Part. 1. cab, Part. This project cannot compress or extract Install. Shield CAB files. You cannot add files to or delete files from an existing CAB archive. For Windows 9. 5/9. ME Microsoft's "Layer for Unicode" must be installed. Source Code. You will find a very clean source code with a tidy error handling and plenty comments written by a very experienced programmer. You get a high quality library and you will save several weeks of coding time. The code is reusable, you can reuse for example the Internet class for downloads from FTP / HTTP(S) or the Blowfish class. You can study Lib. Extract. h to see how managed callbacks can be passed to unmanaged C++ code (which is not easy and requires gcroot or GCHandle)All code is written in Plain C++ / Manged C++ and does not use MFC to avoid problems with missing DLLs on the computers where your application will run. Different CAB File Formats. There are two completely different types of CAB files: The ones which this project supports are the "Microsoft CAB" files (also called "MS- CAB"). The internal pack format may be Microsoft's MSZIP or LZX. Some years later, Install. Shield created the "Install. Shield CAB" files. But these are absolutely incompatible with the MS- CAB files although they use the same file extension! If you open a MS- CAB file with a hex editor, you will notice that the first four bytes are "MSCF" (Micro. Soft Cab File), while the first three bytes of an Install. Shield- CAB file are "ISc". Install. Shield Cab). You cannot open or create Install. Shield CAB files with this project. There exist only very few tools which are capable of managing Install. Shield CAB files; for example, the tool Win. Pack which you can download from my homepage. Compression Ratio. MS- CAB files have a very good compression ratio, especially if you use the LZX compression algorithm. To test this I packed a bunch of about hundred text files. This is the result of my test: Pack Format. Packed File Size. CAB (LZX)1. 25 k. BCAB (MSZIP)1. 39 k. BTAR + GZ1. 42 k. BARJ1. 74 k. BTAR + LZH1. BRAR1. 97 k. BTAR + JAR2. BZIP2. 42 k. BMSZIP versus LZXYou can choose between two compression algorithms: Feature. MSZIPLZXSpeedfasterslower. Compression ratiolowerhigher. Compresses files separatelyyesno. Partial URL Extraction possibleyesno. MSZIP compresses each file one by one and then stores the compressed data into the CAB file. LZX works completely different: It first creates a Huffman Tree from all files and then stores the entire tree into the CAB file. The consequence is notable when you compress the same file multiple times: Compressing 3 identical (or nearly identical) files with MSZIP results in 3. CAB size compared to compressing one file. Compressing 3 identical (or nearly identical) files with LZX results in approx 1. CAB size. Intelligent Installers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
October 2016
Categories |