How Devices and Driver Packages are Uninstalled
This section provides an overview of what you need to do to uninstall a device and driver package. Perform these actions by running one of the following:
- The Driver Install Frameworks (DIFx) tools.Note The DIFx tools do not support uninstalling a device, but can be used to uninstall the driver package that was installed on the device.
These actions include the following:
This uninstall action removes the device node (devnode) that represents the physical instance of the device in the system. Devnodes are removed by using one of the following methods:
Device Manager. For more information, see Using Device Manager.
When a device is uninstalled by using one of these methods, the Plug and Play (PnP) manager removes a subset of the system states that were created during device installation. For example, it removes the association between the driver binary files and the device. This association is used by the Service Control Manager (SCM) to load the appropriate driver for the device.
This uninstall action does not undo all the actions that were performed during the installation process. For example, the driver package and the driver's binary files remain where they were copied to the local hard disk. Some registry keys that were created by a class installer or co-installer (together with some other registry operations) are not changed.
This uninstall action deletes the files that are associated with the driver package from the driver store and removes the associated metadata from the PnP manager's internal database. This action also deletes the INF files, which are associated with the driver package, from the system INF directory.
After the driver package has been removed from the driver store, it is no longer available to be installed on a device. The driver package must be restaged and installed to the driver store from the original source, such as optical media, a network share, or Windows Update.
This uninstall action deletes the driver's binary files from the target system directory. This directory is typically %SystemRoot%\System32\Drivers.
Device Manager and the PnP manager do not support this uninstall action. You must complete this action by using the DIFx tools. These tools verify the consistency between the binary file on the target destination and the file in the driver store. These tools do not rely on the file path and file name. Therefore, we strongly recommend that you implement your uninstaller based only on the DIFx tools. These tools are designed to support robust uninstall procedures.
When you uninstall a driver package, the associated driver binaries might still be used by devices or applications. Removing the binaries can lead to system failures. Before you remove any driver binaries, make sure that the binaries are not still being used by any other component on the system and can be safely removed.