InstallDriver method

The InstallDriver method installs a driver package on all devices that match a specified hardware ID. If a driver is currently installed for matching devices, the driver from the driver package is installed only if it is ranked higher than the driver that is currently installed.

Syntax

HRESULT InstallDriver(
  [in]           IDriverPackage *pDriverPackage,
  [in]           BSTR HardwareId,
  [out, retval]  VARIANT_BOOL *pRebootRequired
);

Parameters

  • pDriverPackage [in]
    The driver package to install as represented by a DriverPackage object.

  • HardwareId [in]
    The hardware ID of the devices for which the driver package will be installed.

  • pRebootRequired [out, retval]
    A Boolean value that specifies if a restart is required to complete the installation of the driver package. This parameter will be VARIANT_TRUE if a restart is required to complete the installation.

Return value

InstallDriver returns a standard HRESULT value.

Remarks

The InstallDriver method installs a driver package, represented by a DriverPackage object, on all devices that match the specified hardware ID. For more information about hardware IDs, see Device Identification.

If a driver is currently installed, the method only installs the driver package if the driver in the package is ranked higher than the driver that is currently installed. For more information about driver selection and ranking, see How Setup Selects Drivers.

Note  To install a driver package on one specific device, use the DeviceManagement::InstallFromInf method.

WDTF does not override system security policies, such as installing unsigned driver packages on 64-bit platforms of Windows Vista and later versions of Windows. Therefore, you cannot use the InstallDriver method to install an unsigned driver package on these platforms.

For more information about how to sign a driver package, see Driver Signing.

Note  A driver package that is installed by calling the InstallDriver method is not published to the Microsoft Windows Device Testing Framework (WDTF) driver package collection. To publish a driver package, call the DeviceManagement::AddDriverPackage method. For more information about the WDTF driver package collection, see IDriverPackageCollection

See also

Device Identification

DeviceManagement

DeviceManagement::AddDriverPackage

DeviceManagement::InstallFromInf

IDriverPackageCollection

 

 

Send comments about this topic to Microsoft

Build date: 1/12/2012