Previous Next

INF ClassInstall32 Section

[ClassInstall32] |
[ClassInstall32.nt] |
[ClassInstall32.ntx86] |
[ClassInstall32.ntia64]

 

AddReg=add-registry-section[, add-registry-section] ...
[Copyfiles=@filename | file-list-section[, file-list-section] ...]
[DelReg=del-registry-section[, del-registry-section] ...]
[Delfiles=file-list section[, file-list-section] ...]
[Renfiles=file-list-section[, file-list-section] ...]
[BitReg=bit-registry-section[,bit-registry-section]...]
[UpdateInis=update-ini-section[,update-ini-section]...]
[UpdateIniFields=update-inifields-section[,update-inifields-section]...]
[Ini2Reg=ini-to-registry-section[,ini-to-registry-section]...]
 
 

A ClassInstall32 section installs a new device setup class (and possibly a class installer) for devices of the new type.

Valid Directives

AddReg=add-registry-section[, add-registry-section] ...
References one or more named sections containing class-specific value entries to be written into the registry. Typically, this is used to give the new device setup class at least a friendly name that other components can later retrieve from the registry and use to open installed devices of this new device class, to "install" any new device class installer and/or property-page provider for this device setup class, and so forth. An HKR specification in any add-registry-section designates the ..Class\{SetupClassGUID} registry key. For additional information, see the following Comments section.

For more information, see INF AddReg Directive.

Copyfiles=@filename | file-list-section[, file-list-section] ...
Either specifies one named file to be copied from the source media to the destination or references one or more named sections in which class-relevant files on the source media are specified for transfer to the destination. The DefaultDestDir entry in the DestinationDirs section of the INF specifies the destination directory for any class-specific single file to be copied.

System-supplied INF files for device setup classes (and class installers) do not use this directive in this section.

For more information, see INF CopyFiles Directive.

DelReg=del-registry-section[, del-registry-section] ...
References one or more named sections in which value entries or keys are specified to be removed from the registry during installation of the class installer.

However, if a particular {SetupClassGUID} subkey exists in the registry ..Class branch, the system setup code subsequently ignores the ClassInstall32 section of any INF that specifies the same GUID value in its Version section. Consequently, an INF cannot replace an existing class installer or modify its behavior from a ClassInstall32 section. To modify the behavior of existing class installer, use a class-specific co-installer.

For more information, see INF DelReg Directive.

Delfiles=file-list section[, file-list-section] ...
References one or more named sections in which previously installed class-relevant files on the destination are specified for deletion.

For more information, see INF DelFiles Directive.

Renfiles=file-list-section[, file-list-section] ...
References one or more named sections in which class-relevant files to be renamed on the destination are listed.

For more information, see INF RenFiles Directive.

BitReg=bit-registry-section[,bit-registry-section]...
Is valid in this section but almost never used.

For more information, see INF BitReg Directive.

UpdateInis=update-ini-section[,update-ini-section]...
Is valid in this section but almost never used.

For more information, see INF UpdateInis Directive.

UpdateIniFields=update-inifields-section[,update-inifields-section]...
Is valid in this section but almost never used.

For more information, see INF UpdateIniFields Directive.

Ini2Reg=ini-to-registry-section[,ini-to-registry-section]...
Is valid in this section but almost never used.

For more information, see INF UpdateIniFields Directive.

Comments

An INF for devices in a system-supplied device setup class should not specify a ClassInstall32 section. (You can provide class-specific or device-specific co-installers to supplement system-supplied class installers or the system's device installer. For more information, see Writing a Co-installer.)

Usually, a ClassInstall32 section will have one or more AddReg directives to add entries under a system-provided SetupClassGUID subkey in the registry. These entries can include a class-specific "friendly name," class installer path, class icon, property page provider, and so forth.

Except for AddReg and CopyFiles, the other directives shown here are very seldom used in a ClassInstall32 section.

The system processes the ClassInstall32 section of an INF for a new device setup class when a device is about to be installed but the SetupClassGUID value of that device's class is not predefined by the system. (See Device Setup Classes for a list of the system-defined setup class names and GUIDs.)

To support a multiplatform distribution of driver files, construct platform-specific ClassInstall32 sections. For example, all system setup API functions that process a ClassInstall32 section will search first for a ClassInstall32.ntx86 section on an NT-based x86 platform and only look at an undecorated ClassInstall32 section if they cannot find a ClassInstall32.ntx86 section. For more information about how to use the system-defined .nt, .ntx86, and .ntia64 extensions, see Creating INF Files for Multiple Platforms and Operating Systems. Note that the ClassInstall32 section name is also used for installations on 64-bit platforms.

In the registry, every device installed on Windows 2000 and later platforms is associated with a device setup class. If the INF for a device to be installed is not associated with a new device class installer, or if its ClassGUID= specification in the Version section does not match a system-defined setup class GUID, that device's registry subkey is created under ..Class\{UnknownClassGUID}.

The INF for any device class installer typically has an AddReg directive in its ClassInstall32 section, to define at least one named section that creates a friendly name for its kind of device. The setup code automatically creates a SetupClassGUID subkey in the registry from the value supplied for the ClassGUID= entry in the INF's Version section when the first device of that (new) setup class is installed.

Under this SetupClassGUID subkey, such an INF also provides registry information for Models-specific subkeys, using additional AddReg directives in its per-manufacturer, per-models DDInstall sections. In addition, the INF can use the add-registry sections referenced in its ClassInstall32 section to specify a property-page provider and to exert control over how its class of devices is handled in the user interface.

Such a class-specific add-registry section has the following general form:

[SetupClassAddReg]
 

HKR,,,,%DevClassName% ; device-class friendly name
[HKR,,Installer32,,"class-installer.dll,class-entry-point"]
[HKR,,EnumPropPages32,,"prop-provider.dll,provider-entry-point"]
HKR,,Icon,,"icon-number"
[HKR,,SilentInstall,,1]
[HKR,,NoInstallClass,,1]
[HKR,,NoDisplayClass,,1]

The system uses the specified icon to represent your installer to the user.

Setting the predefined SilentInstall, NoDisplayClass, and NoInstallClass Boolean value entries in a class-specific registry key has the following effects:

A ClassInstall32 section can contain AddReg directives to set the DeviceType, DeviceCharacteristics, and Security for devices of its setup class. See the INF AddReg Directive for more information.

Examples

This example shows the ClassInstall32 section, along with the named section it references with the AddReg directive, of the INF for the system display class installer.

[ClassInstall32] 
AddReg=display_class_addreg
 
[display_class_addreg]
HKR,,,,%DisplayClassName%
HKR,,Installer32,,"Desk.Cpl,DisplayClassInstaller"
HKR,,Icon,,"-1"

By contrast, this example shows the add-registry section referenced in the system CD-ROM INF's ClassInstall32 section. It sets up a class-specific property-page provider for the CD-ROM devices/drivers that it installs. This INF also sets the SilentInstall and NoInstallClass value entries in the CD-ROM class key to TRUE (1).

[cdrom_class_addreg]
HKR,,,,%CDClassName%
HKR,,EnumPropPages32,,"SysSetup.Dll,CdromPropPageProvider"
HKR,,SilentInstall,,1
HKR,,NoInstallClass,,1
HKR,,Icon,,"101"

See Also

AddReg, BitReg, CopyFiles, DDInstall, DelFiles, DelReg, Ini2Reg, Models, RenFiles, SetupDiBuildClassInfoListEx, UpdateIniFields, UpdateInis, Version