Updating Driver Files
Drivers are updated when a user runs the Hardware Update Wizard. Following is a set of guidelines to follow when writing installation software and INF files that update existing drivers.
- Installation software can call UpdateDriverForPlugAndPlayDevices, supplying an INF file and a hardware ID, to update drivers for devices that match the hardware ID. For more information, see Writing a Device Installation Application.
- When upgrading a driver, class installers and co-installers should not supply finish-install pages in response to DIF_NEWDEVICEWIZARD_FINISHINSTALL unless absolutely necessary. If possible, obtain finish-install information from the settings of the previous installation.
- To the extent possible, class installers and co-installers should avoid basing behavior on whether they are providing an initial installation or are updating drivers for an already-installed device.
- For Windows XP and later, the registry values CoInstallers32 and EnumPropPages32 are deleted prior to delivery of DIF_REGISTER_COINSTALLERS. INF files for earlier OS versions must explicitly either delete these values or perform a non-appending modify operation on them.
- For Windows XP and later, the registry values UpperFilters and LowerFilters are deleted prior to delivery of DIF_INSTALLDEVICE. INF files for earlier OS versions must explicitly either delete these values or perform a non-appending modify operation on them.
- Do not use INF DelFiles directives or INF RenFiles directives when updating drivers. Setup cannot guarantee that a particular file is not being used by another device. (Class installers and co-installers can delete or rename files, if they can reliably determine that no devices are using the files.)
- Use the INF DelReg directive to remove old device-specific registry entries from a previous installation of the device, if the entries are no longer needed. (Do not remove global registry entries.)
- Do not use the INF DelService directive in an INF DDInstall.Services section to remove previously installed device/driver services from the target machine. Setup cannot guarantee that a particular service is not being used by another device. (Class installers and co-installers can delete services, if they can reliably determine that no devices are using the services.)
- When updating a class installer, class co-installer, or service DLL, you must give the new version a new file name.