INF ClassInstall32 section

Caution

If you are building a universal or Windows Driver package, this section is not valid. See Using a Universal INF File and Get started developing Windows drivers.

A ClassInstall32 section installs a new device setup class for devices in the new class.

[ClassInstall32] | 
[ClassInstall32.nt] | 
[ClassInstall32.ntx86] |
[ClassInstall32.ntia64] | (Windows XP and later versions of Windows)
[ClassInstall32.ntamd64] | (Windows XP and later versions of Windows)
[ClassInstall32.ntarm] | (Windows 8 and later versions of Windows) 
[ClassInstall32.ntarm64] (Windows 10 version 1709 and later versions of Windows) 

AddReg=add-registry-section[,add-registry-section]...
[AddProperty=add-property-section[,add-property-section] ...]  (Windows Vista and later versions of Windows)
[Copyfiles=@filename | file-list-section[,file-list-section]...]
[DelReg=del-registry-section[,del-registry-section]...]
[DelProperty=del-property-section[,del-property-section] ...]  (Windows Vista and later versions of Windows)
[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]...]

Entries

AddReg=add-registry-section[,add-registry-section]...
References one or more named sections that contain 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 or to "install" any property-page provider for this device setup class, and so forth.

An HKR specification in any add-registry-section designates the registry key that contains settings for that class. For additional information, see the following Remarks section.

For more information, see INF AddReg Directive.

AddProperty=add-property-section[,add-property-section]...
(Windows Vista and later versions of Windows) References one or more INF file sections that modify device properties that are set for a device setup class. You should use an INF AddProperty directive only to set a device setup class property that is new to Windows Vista or later versions of Windows operating systems.

For device class properties that were introduced earlier on Windows Server 2003, Windows XP, or Windows 2000, and that have corresponding registry entry values, you should continue to use an INF AddReg directives to set the device setup class property. These guidelines apply to system-defined properties and custom properties.

For more information about how to use the AddProperty directive, see Using the INF AddProperty Directive and the INF DelProperty 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.

For more information, see INF CopyFiles Directive.

Note

System-supplied INF files for device setup classes do not use this directive in this section.

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} already exists as an installed class, 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.

For more information, see INF DelReg Directive.

DelProperty=del-property-section[,del-property-section]...
(Windows Vista and later versions of Windows) References one or more INF file sections that delete device properties that are set for a device setup class. You should use an INF DelProperty directive only to delete a device setup class property that is new to Windows Vista or later versions of Windows operating systems.

For device class properties that were introduced earlier on Windows Server 2003, Windows XP, or Windows 2000, and that have corresponding registry entry values, you should continue to use an INF DelReg directives to delete the device setup class property. These guidelines apply to system-defined properties and custom properties.

For more information about how to use the DelProperty directive, see Using the INF AddProperty Directive and the INF DelProperty 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.

Remarks

You should include a ClassInstall32 section in a device INF file only to install a new custom device setup class. INF files for devices in an installed class, whether a system-supplied device setup class or a custom class, should not include a ClassInstall32 section. Because the system processes a ClassInstall32 section only if a class is not already installed, you cannot use a ClassInstall32 section to reinstall or change the settings for a class that is already installed. In particular, you cannot use a ClassInstall32 section to add a class co-installer or a class filter driver for a class that is already installed. For information about how to install co-installers and filter drivers, see Writing a Co-installer and Installing a Filter Driver.

Usually, a ClassInstall32 section has 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 rarely used in a ClassInstall32 section.

To support a multiplatform distribution of driver files, construct platform-specific ClassInstall32 sections. For example, all system SetupAPI functions that process a ClassInstall32 section will search first for a ClassInstall32.ntx86 section on an x86 platform and only examine an undecorated ClassInstall32 section if they cannot find a ClassInstall32.ntx86 section. For more information about how to use the system-defined .nt, .ntx86, .ntia64, .ntamd64, .ntarm, and .ntarm64 extensions, see Creating INF Files for Multiple Platforms and Operating Systems.

Note

The ClassInstall32 section name is also used for installations on 64-bit platforms.

Starting with Windows 2000, every installed device 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 is associated with the device setup class with name "Unknown".

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 key in the appropriate place 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.

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.

  • If the Icon value is positive, it represents a resource identifier for a resource. The resource is extracted from the class installer DLL, if the Installer32 key is specified, or from the property page DLL, if the EnumPropPages32 key is specified. The value "0" represents the first icon in the DLL. The value "1" is reserved.
  • If the Icon value is negative, the absolute value is the resource identifier of the icon in SetupApi.DLL.

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

  • Setting SilentInstall directs installers to send no popup messages to the user that require a response while installing devices of this class, whether specified in the DDInstall sections of the class installer's INF file or in separate INF files for subsequently installed devices that declare themselves of this class by setting the same ClassGuid={ClassGUID} specification in their respective Version sections. For example, the system class installers of CD-ROM and disk devices and the system parallel port class installer set SilentInstall in their respective registry keys.

    If a class-specific installer requires the computer to be restarted for any device that it installs, the class-specific add-registry section in its INF cannot have this value entry.

  • Setting NoDisplayClass suppresses the user-visible display of all devices of this class by Device Manager. For example, the system class installers for printers and for network drivers (including clients, services, and protocols) set NoDisplayClass in their respective registry keys.

  • Setting NoInstallClass indicates that no device of this type will ever require manual installation by an end-user. For example, the system class installers for exclusively Plug and Play (PnP) devices set NoInstallClass in their respective registry keys.

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.

[ClassInstall32] 
AddReg=example_class_addreg

[example_class_addreg]
HKR,,,,%ClassName%
HKR,,Icon,,"-1"

By contrast, this example sets up a class-specific property-page provider. This INF also sets the SilentInstall and NoInstallClass value entries in the class key to TRUE (1).

[example_class_addreg]
HKR,,,,%ClassName%
HKR,,EnumPropPages32,,"ExampleBinary.Dll,ExamplePropPageProvider"
HKR,,SilentInstall,,1
HKR,,NoInstallClass,,1
HKR,,Icon,,"101"

See also

AddProperty

AddReg

BitReg

CopyFiles

DDInstall

DelFiles

DelProperty

DelReg

Ini2Reg

Models

RenFiles

SetupDiBuildClassInfoList

UpdateIniFields

UpdateInis

Version