Driver Package

A driver package consists of all the software components that you must supply in order for your device to be supported under Windows. Installing a device or driver involves system-supplied and vendor-supplied components. The system provides generic installation software for all device classes. Vendors must supply one or more device-specific components within the driver package. The following components are necessary to install and support a device on a Windows operating system:

Driver Files

The driver is the part of the package that provides the I/O interface for a device. Typically, a driver is a dynamic-link library (DLL) with the .sys file name extension. Long file names are allowed, except for boot-start drivers. When a device is installed, Windows copies the .sys file to the %SystemRoot%\system32\drivers directory. The software that is required to support a particular device depends on the features of the device and the bus or port to which it connects. Microsoft ships drivers for many common devices and nearly all buses with the operating system. If your device can be serviced by one of these drivers, you might have to write only a device-specific minidriver. A minidriver handles device-specific features on behalf of a system-supplied driver. For some types of devices, even a minidriver is not necessary. For example, modems can typically be supported with just installation files.

Device setup information (INF file)

An INF file contains information that the system Windows components use to install support for the device. Windows copies this file to the %SystemRoot%\inf directory when it installs the driver. An INF file is a text file that contains all the information necessary to install a device, such as Manufacturer and device model information, driver names and locations, registry information, version information, and other installation information that is used by the Setup components. Windows INF files do not contain installation scripts. The installation procedures are part of a Microsoft Win32 installer application with INF file acting only as a resource.

Driver Catalog (.cat) file

Windows device installation uses digital signatures to verify the integrity of driver packages and to verify the identity of the vendor (software publisher) who provides the driver packages. A driver catalog file contains a cryptographic hash of each file in the driver package. Windows uses these hashes to verify that the package was not altered after it was published. To ensure that the catalog file is not altered, it should be digitally signed and a driver catalog file contains digital signatures. A vendor obtains digital signatures by submitting its driver package to the Windows Hardware Quality Lab (WHQL) for testing and signing. WHQL returns the package with a catalog file (.cat file).

Device setup classes

Used to group devices together that are installed and configured in a similar manner. To facilitate device installation, devices that are set up and configured in the same manner are grouped into a device setup class. The device setup class defines the class installer and class co-installers that are involved in installing the device. Microsoft defines setup classes for most devices. IHVs and OEMs can define new device setup classes, but only if none of the existing classes apply. There is a GUID associated with each device setup class. The device setup class GUID defines the ..\CurrentControlSet\Control\Class\ClassGuid registry key under which to create a new subkey for any particular device of a standard setup class. Device setup classes provide a mechanism for grouping devices that are installed and configured in the same way. A setup class identifies the class installer and class co-installers that are involved in installing the devices that belong to the class. For example, all CD-ROM drives belong to the CDROM setup class and will use the same co-installer when installed.Windows classes are defined in the system file Devguid.h. This file defines a series of GUIDs for setup classes. HKLM\SYSTEM\CurrentControlSet\Control\Class Contains information about the device setup classes on the system. There is a subkey for each class that is named using the GUID of the setup class. Each subkey contains information about a setup class, such as the class installer (if there is one), registered class upper-filter drivers, and registered class lower-filter drivers. Each class subkey contains other subkeys known as software keys (or, driver keys for each device instance of that class installed in the system. Each of these software keys is named by using a device instance ID, which is a base-10, four-digit ordinal value.

Class installer

Required only for new device setup classes; system-supplied for existing classes. As a rule, vendors should not define new setup classes, and should not supply class installers. If a to-be-installed component, such as a new class driver, provides one or more new device interface classes to higher-level components, its INF file has this section. In effect, this section bootstraps a set of device interfaces for a new class by setting up whatever is needed to use the functionality that the interface class provides. A class installer DLL performs installation operations that apply to devices in a particular device setup class. For example, the system-supplied Ports class installer is responsible for assigning a COM port name to a device in the Ports setup class. If the devices in a particular setup class do not require any special installation operations, a class installer is not required for that setup class. Microsoft provides class installers for the system-supplied device setup classes that require a class installer. For devices that belong to these setup classes, a vendor can provide a co-installer to perform additional setup operations, if needed. If you create a new device setup class for your device, you might have to write a class installer. However, you rarely have to create a new device setup class because most devices can be associated with one of the system-supplied device setup classes. For example, the maker of a digital camera might think that digital cameras require a new setup class. However, cameras fall under the image class.

Co-installers

A co-installer is an optional Microsoft Win32 DLL that supplements the operations of the system's device installer or of an existing device class installer and assists in device installation on Windows operating systems. A co-installer typically writes additional configuration information to the registry or performs other installation tasks that require dynamically generated, system-specific information that is not available when an INF is created. A device-specific co-installer supplements the installation operations either of the OS's device installer or of the appropriate class installer when that device is installed. Co-installers are called by SetupAPI as "helpers" for Class Installers. For example, a vendor can provide a co-installer to write device-specific information to the registry that cannot be handled by the INF file. The registry key HKLM\SYSTEM\CurrentControlSet\Control\CoDeviceInstallers Contains information about the class-specific co-installers that are registered on the system.

  1. Device co-installer

    A device co-installer handles custom installation requirements for a specific device or family of devices. Required if installation requires information from the user or from the registry. Often supplied by vendors. On the other hand, vendors often supply device co-installers. You should write a device co-installer if you have to display property pages or custom Finish pages during device or driver installation.

  2. Class co-installer

    A class co-installer performs identical actions for every device in its class. Required only if installation of all devices of this class requires information from the user or from the registry. System-supplied for classes that require them; vendors should rarely supply them. Microsoft supplies class co-installers for classes that require them; third parties seldom do.

Driver Store

The driver store is a trusted collection of inbox and third-party driver packages. The operating system maintains this collection in a secure location on the local hard disk. Only the driver packages in the driver store can be installed for a device. When a driver package is copied to the driver store, all of its files are copied. This includes the INF file and all files that are referenced by the INF file. All files that are in the driver package are considered critical to the device installation. The INF file must reference all of the required files for device installation so that they are present in the driver store. If the INF file references a file that is not included in the driver package, the driver package is not copied to the store. The process of copying a driver package to the driver store is called staging. A driver package must be staged to the driver store before the package can be used to install any devices. As a result, driver staging and device installation are separate operations. A driver package is staged to the driver store by being verified and validated: Verifying the driver package integrity. Software integrity has become a top priority for IHVs and OEMs. Concerned by the increase in malicious software on the Internet, these customers want to be sure that their software has not been tampered with or corrupted. Before a driver package is copied to the driver store, the operating system first verifies that the digital signature is correct. Validating the driver package. The operating system validates the driver package in the following ways: The current user must have permission to install the driver package. The INF file of the driver package is syntactically correct, and all files referenced by the INF files are present in the driver package. After a driver package has passed integrity and syntax checks, it is copied to the driver store. Afterwards, the operating system uses the driver package to automatically install new devices without requiring user interaction.

Other files

A driver package can contain other files, such as a custom device installation application recommended when value-added software is provided with device and driver, or when a driver replaces a previous driver that might already be installed, a device icon, or a driver library file (such as for video drivers). The same can also include Device and Driver Installation software - the various software components that can be optionally developed to enhance device and driver installations like Wizard Pages, Device Property Pages.