HOWTO: Modify and Rebuild .cab Files Built with PDW

ID: Q191212


The information in this article applies to:


SUMMARY

When you use the Visual Basic Package & 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 & Deployment Wizard creates, how to extract the files from a .cab file, and how to rebuild the .cab file.


MORE INFORMATION

When you create a distribution package with the Package & Deployment Wizard, it creates the .cab file(s) that are used to install your application.

The Contents of a .cab File

A .cab file contains compressed files that are necessary for installing your application. The Package & 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 & 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 & Deployment Wizard also includes an .inf file.

Extracting the Contents of a .cab File

To 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, 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:
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 File

Once 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 & 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 Files

Normally, 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:


REFERENCES

For more information about using Extract.exe, MakeCab.exe, modifying .ddf files, or modifying .inf files, please see the documentation found in the ActiveX Software Development Kit (SDK). The ActiveX SDK is available for download from the following location:

http://www.microsoft.com/workshop/misc/activexsdk/default.asp

For additional information, please see the following articles in the Microsoft Knowledge Base:
Q176810 : HOWTO: Manually Modify and Rebuild CAB Files

Q132913 : How to Use EXTRACT.EXE to Copy Files from DMF Disks

Additional query words: directory


Keywords          : kbAppSetup kbVBp600 
Version           : 
Platform          : 
Issue type        : kbhowto 

Last Reviewed: May 14, 1999