[DDInstall] |
[DDInstall.HW] |
[DDInstall.CoInstallers] |
[ClassInstall32] |
[ClassInstall32.ntx86] |
[ClassInstall32.ntia64]
DelReg=del-registry-section[, del-registry-section] ...
A DelReg directive references one or more INF-writer-defined sections describing keys and/or value entries to be removed from the registry.
A DelReg directive can be specified under any of the sections shown in the formal syntax statement above. This directive also can be specified under any of the following INF-writer-defined sections:
In general, an INF should never attempt to delete subkeys or value entries within existing subkeys that were set up by system components or by the INF files for other devices. The purpose of a delete-registry section is to clean stale registry information from a previous installation using a new INF file supplied by the same provider.
Each del-registry-section name must be unique to the INF file, but it can be referenced by DelReg directives in other sections of the same INF. Each section name must follow the general rules for defining section names described in General Syntax Rules for INF Files. For information about how to use the system-defined .nt, .ntx86, and .ntia64 extensions, see Creating INF Files for Multiple Platforms and Operating Systems.
Each named section referenced by a DelReg directive has the following form:
[del-registry-section]
reg-root-string, subkey[, value-entry-name][, flags][, value]
reg-root-string, subkey[, value-entry-name][, flags][, value]
...
A del-registry-section can have any number of entries, each on a separate line.
| INF Section Containing DelReg Directive | Registry Key Referenced by HKR |
|---|---|
| INF DDInstall section | The device's software key |
| INF DDInstall.HW section | The device's hardware key |
| INF DDInstall.Services section | The Services key |
Note that HKR cannot be used in an del-registry-section referenced from an INF DefaultInstall section.
For more information about driver information stored under the HKEY_LOCAL_MACHINE root, see Driver Information in the Registry.
With operating system versions prior to Windows XP, the only way to delete a key is by specifying:
reg-root-string, subkey
For Windows XP and later, the following is also permitted (to specify the 32-bit registry):
reg-root-string, subkey,,0x4000
This example shows how the system-supplied COM/LPT ports class installer's INF removes stale NT-specific registry information about COM ports from the registry.
[ComPort.NT] CopyFiles=ComPort.NT.Copy AddReg=ComPort.AddReg, ComPort.NT.AddReg ... ; more directives omitted here [ComPort.NT.HW] DelReg=ComPort.NT.HW.DelReg [ComPort.NT.Copy] serial.sys serenum.sys [Comport.NT.AddReg] HKR,,EnumPropPages32,,"MSPorts.dll,SerialPortPropPageProvider" [ComPort.NT.HW.DelReg] HKR,,UpperFilters
AddReg, AddInterface, AddService, BitReg, ClassInstall32, DDInstall, DDInstall.CoInstallers, DDInstall.HW, DDInstall.Services, InterfaceInstall32, Strings