Article ID: 191212 - View products that this article applies to.
This article was previously published under Q191212
When you use the Visual Basic Package and Deployment Wizard (PDW) to create a distribution set for your application, you may need to modify the .cab file created by the wizard.
This article describes how to modify the .cab files that the Package and Deployment Wizard creates, how to extract the files from a .cab file, and how to rebuild the .cab file.
When you create a distribution package with the Package and Deployment Wizard, it creates the .cab file(s) that are used to install your application.
The Contents of a .cab FileA .cab file contains compressed files that are necessary for installing your application. The Package and Deployment Wizard places an decompressed copy of each of these files in a folder named "Support," which can be found in the same location as the .cab file.
In all cases, the Package and Deployment Wizard places at least two files in the Support folder: a .ddf file and a component file (.exe, .dll, or .ocx file). If you are creating an Internet download package, the Package and Deployment Wizard also includes an .inf file.
Extracting the Contents of a .cab FileTo extract the contents of 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 Me, or Windows NT installation disc.
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 Project1.cab *.*
where "Project1.cab" is the name of your cabinet file.
For more information on using the Extract.exe utility, you can type the following command at an MS-DOS command prompt:
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 file, you can make modifications to those files and then proceed to rebuild the .cab file manually.
To rebuild a .cab file, the Package and Deployment Wizard provides a batch (.bat) file. The batch file will have the same name as your .cab file, but with a .bat extension. The wizard places this file into the Support folder for your package. Double-click the .bat file in Windows Explorer or run the .bat file from the MS-DOS prompt to rebuild the .cab file.
The .bat file runs the MakeCab.exe utility that ships with Visual Basic. The MakeCab utility is installed by default in the following folder:
C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard\
You can also find the MakeCab utility on your Visual Basic installation disc.
To rebuild the cabinet file without the .bat 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 file.
At a command prompt, type the following command where "Project1.ddf" is the name of your .ddf file:
MakeCab /F Project1.ddf
For more information about the MakeCab utility, you can use the "/?" switch, or see the ActiveX SDK documentation as referred to in the REFERENCES section of this article.
Notes on Rebuilding Cabinet FilesNormally, you do not need to modify the files within a cabinet file. However, if you do need to modify cabinet files, please use the following guidelines to avoid problems:
For additional information about using Extract.exe, MakeCab.exe, modifying .ddf files or modifying .inf files, click the following article number to view the article in the Microsoft Knowledge Base:
310618For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/310618/ )Microsoft Cabinet Software Development Kit
(http://support.microsoft.com/kb/176810/ )How to manually modify and rebuild CAB files
(http://support.microsoft.com/kb/132913/ )How to use Extract.exe to copy files from the cabinet files
Contact us for more help
Connect with Answer Desk for expert help.