Making Cabinets

This article has two sections:
See the sample or the readme.

Creating a CAB file using a DDF file

This sample includes a .DDF file, FIRSTCAB.DDF. A DDF file describes the layout of the .CAB file that will be created.

To create the CAB file:

      C:\CABDIR\DIAMOND /F FIRSTCAB.DDF
This assumes you installed the Cabinet Development Kit in C:\CABDIR.

If you have not installed the Cabinet Development Kit, you can find it on the CD in the \CAB&SIGN directory.

Return to the top of this article.


Creating your own DDF file

To put together your own cab file, you need to create a DDF file. The DDF file is a text file that tells DIAMOND exactly how you want the CAB file to be laid out. DDF files can be quite complex, especially if they describe the layout of CAB files used for software installation. Fortunately, CAB files for distributing components over the Internet are far simpler than those used for installation programs.

Create a .DDF file with the following lines in it:

    .OPTION EXPLICIT 
    .Set CabinetNameTemplate=CABNAME.cab
    .Set DiskDirectoryTemplate=
    .Set Cabinet=on
    .Set Compress=on
    .Set ReservePerCabinetSize=6144
    CLASSNAME.class
    CLASSNAME.class
where CABNAME is the name of the CAB file to be created (in this case, FIRSTCAB.CAB), and CLASSNAME entries form a list of the files to include in the CAB file (in this case, javabeep.class).

Save this file in the project directory. Give it some descriptive name. It will simplify maintenance if the name of the DDF file is the same as the name of the CAB file it describes. Use the file extension .DDF.

As you add classes to this project, add them to the list at the bottom of the DDF file.

As you see, working with CAB files is quite simple once you get used to creating them. In fact, they are very convenient. A CAB will download faster than the individual files because the files in the CAB are in a compressed format. Also, multiple class files can be packaged together into a single CAB file. This also increases efficiency, since packaging multiple class files for an applet as a single CAB file decreases the number of network-access operations needed to download the applet.

Return to the top of this article.