6.12 Cab Files

Cab files are used only in legacy web environments in which Windows Installer files cannot be used. They are much less flexible than Windows Installer filesCab files are simply a collection of files and some dependency information. They are mostly used to deploy ActiveX controls to web browsers.

Visual Studio .NET does not present any views for a Cab File project. A Cab file's contents can be viewed only in the Solution Explorer. As Figure 6-23 shows, the Solution Explorer simply shows the files the Cab file will contain.

Figure 6-23. A Cab File project

You can add files to a Cab with the Add Project Output... and Add File... project context menu items. These work in much the same way as adding files to a Windows Installer Setup project, except Cab files don't have any notion of a destination directory.

The Cab project itself has three properties. FriendlyName is the public name that will be stored in the Cab file. This name can be displayed by applications that understand Cab files, such as Internet Explorer. A Version number may be set. Finally, the WebDependencies property allows a list of other Cab files that this file depends on to be specified.

If you edit the WebDependencies property, the dialog in Figure 6-24 will be shown. This lists the file's dependencies. For each dependency, you can specify the URL at which the dependent Cab file can be found, what its friendly name is expected to be, and the expected version number. This information will be processed by applications that understand Cab files. For example, Internet Explorer can use this information to work out what other files need to be downloaded when installing an ActiveX control from the Web.

Figure 6-24. Cab file dependencies