Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
How To Manually Modify and Rebuild CAB Files
Article ID: 176810 - View products that this article applies to.
This article was previously published under Q176810
When using the Visual Basic 5.0 Application Setup Wizard to create an Internet Component Download Setup for your ActiveX control or ActiveX document, you may need to modify the CAB file created by the Setup Wizard.
This article describes how to modify the CAB files that the Visual Basic Setup Wizard creates and specifically shows how to extract the files from a CAB file and how to rebuild the CAB file.
For distributing ActiveX components, you may choose to build an Internet Component Download Setup using the Visual Basic 5 Application Setup Wizard.
The wizard creates two key files: an HTM file (Hypertext Markup Language File, also known as HTML file) and a CAB file (Cabinet file, a compressed file). The HTM file contains the information necessary to extract and install the information stored in the CAB file. The CAB file contains the actual components of your OCX, EXE, or DLL.
When you open the HTM file with Internet Explorer (IE), IE executes the <OBJECT> tag within the HTML code. In its simplest terms, an <OBJECT> tag tells Internet Explorer how to install your ActiveX component onto the client machine.
The following is an example of an <OBJECT> tag;
In the <OBJECT> tag above, Internet Explorer uses the ID and CLSID to see if the specified control is already installed on the client computer. If it is not already installed or if it out of date, IE uses the CODEBASE argument to locate the ActiveX.CAB file to install the ActiveX control or document.
The Contents of a .CAB FileA CAB file contains compressed files that are crucial for installing your ActiveX components. The Setup Wizard places an uncompressed copy of each file it placed into your cabinet file into a directory named "Support," which can be found in the same location as the CAB and HTM files.
In all cases, the Setup Wizard will place at least three files in the Support folder: a .DDF file, an ActiveX component file (.EXE, .DLL or .OCX file), and an .INF file.
Extracting the Contents of a CAB FileIn order to extract what is in a cabinet file, you must use the Extract utility. Extract.Exe can be found in your Windows folder or on your Windows 95, Windows 98, Windows NT, or Windows 2000 installation CD-ROM.
Extract.Exe is a command-line utility; therefore it is used from an MS-DOS command prompt. To extract the files within a cabinet file, be sure the Extract.Exe utility is in the MS-DOS Path or copy the Extract utility to the same folder as the cabinet file.
From the MS-DOS command prompt, you can run the following command to extract all of the files in a CAB file into the current directory:
Extract ActiveX.CAB *.*where "ActiveX.CAB" is the name of your cabinet file.
For more information on using the Extract.Exe utility, you may type the following command at an MS-DOS command prompt:
Extract /?For even more information on Extract.Exe, please see the ActiveX SDK documentation as referred to in the REFERENCES section of this article.
Rebuilding a CAB FileOnce you've extracted the files within a CAB, you can make modifications and then proceed to rebuild the CAB file manually.
To rebuild a CAB file, you must use the MakeCab.Exe utility that ships with Visual Basic. The MakeCab utility is installed by default in the following directory:
C:\Program Files\DevStudio\Vb\setupkit\kitfil32It may also be found on your Visual Basic 5.0 installation CD-ROM in the following directory:
\VB\Setupkit\Kitfil32To rebuild the cabinet file, place any modified files and the original .DDF file into a single folder. Also, make sure the MakeCab.Exe utility is in the MS-DOS path or copy it to the same folder as the .DDF.
From a command prompt, type the following command:
MakeCab /F ActiveX.DDFwhere "ActiveX.DDF" is the name of your .DDF file.
For more information on the MakeCab utility ,you may use the "/?" switch or see the ActiveX SDK documentation as referred to in the REFERENCES section of this article.
Notes on Rebuilding Cabinet FilesUsually, it should not be necessary to modify the files within a cabinet file. However, situations may arise where you need to do so. When modifying cabinet files, please use the following guidelines to avoid problems:
For more information about how to use the Extract.exe and the MakeCab.exe files and how to modify .ddf or .inf files, see the ActiveX Software Development Kit (SDK) documentation.
Article ID: 176810 - Last Review: July 2, 2004 - Revision: 3.2