There are several different tools for installing drivers in Windows 7. This blog aims to describe them and show how they differ.
Driver installation tools for Windows 7:
Deployment Image Servicing and Management (dism.exe) is the new tool for modifying Windows images. It replaces the individual tools that were introduced for Vista images. There is plenty of documentation about DISM.
DISM is a "framework" tool that gives access to different "providers". The DISM host itself controls things like logging and rebooting. The different providers do the work with their own command line options, called by the DISM host.
- CBSProvider (Component Based Servicing)
- OSProvider (OS updates)
- WIMProvider (handling the WIM file)
- SMIProvider (Settings Management)
- DMIProvider (Driver Management)
DISM is a tool for servicing both Online and Offline images. Dism /image:[path] refers to a mounted offline image. Dism /online refers to the current running image. However, you can not use DISM to add or remove drivers from an online Windows 7 image. The facility to do this does not exist. The commands /add-driver and /remove-driver apply only to offline images. When the image is Online:
- you can add and remove updates
- you can enable and disable features
- you can not add and remove drivers.
Servicing in Audit mode, with the image online, uses PnPUnattend, not DISM.
Driver Package Installer (DPInst.exe) is part of the Driver Installer Framework (DIFx) provided to vendors to enable them to distribute drivers. DIFx gives vendors three tools of varying complexity to install drivers. The intention is that the user just clicks Run and is insulated from the method used.
- DPInst is a very simple installer. Put the inf and sys files together in a folder with a copy of DPInst.exe. Execute DPInst and the driver is imported into the Driver Store. By default, the tool searches the current directory and tries to install all driver packages found.
- DIFxApp is a plug-in or extension to Windows Installer or InstallShield. It provides the actions that enable, for example, a Windows Installer msi to install drivers.
- DIFxApi enables the vendor to write custom installers.
So by using DPInst you would effectively be authoring a driver installation package on behalf of the vendor. Why does Microsoft provide DPInst at all? Because it has simple features to enable a vendor to distribute a driver, including:
- customisation of text, icons and bitmaps
- an option to add an EULA
It might be fun to use this to add drivers during deployment, but it is not what it is for.
DrvInst.exe is the Driver Installation Module of Windows 7. When Windows detects new hardware, DrvInst is the module that selects drivers from the Driver Store and sets up the driver for the hardware.
PnPEnum.exe is a Microsoft utility that enumerates the Plug and Play hardware ID’s in a system. It is not part of the operating system. It is supplied as part of the Microsoft Platform Support Reporting tools. It is also part of Microsoft Deployment Toolkit (MDT).
In MDT 2010 it is used by the ZTIDrivers.wsf script as part of the task of importing drivers:
- PnpEnum.exe outputs the hardware ID’s in pnpenum.xml
- this is matched against the list of MDT Out-of-Box Drivers in drivers.xml
- matching drivers are copied to c:drivers
- c:drivers is defined as the Driver Path in the PnPCustomization component of WinPE or auditSystem.
PnPUnattend.exe is part of the operating system. During the auditSystem pass of setup (if there is one configured to run) it automatically imports drivers in the path defined in the unattend.xml PnpCustomizationsNonWinPE component.
This is specifically to install drivers from a path, unattended, as part of the Audit pass of setup. The command line options are: /s to search the driver path without importing; and /l to show logging information.
PnPUtil.exe is part of the operating system. PnPUtil is a command-line tool to add and remove third party plug and play drivers. After Windows 7 is deployed, you can use PnPUtil to add or update specific drivers.
- PnPUtil -a imports the specified driver or drivers
- PnPutil -e lists the third party drivers that have already been added (but it does not provide a facility to pipe the output to a file)
- PnPUtil -d deletes the specified third party driver.