Preinstalling a PnP Function Driver Package

DIFxAPI supports preinstalling Plug and Play (PnP) driver packages in the DIFx driver store with a single DIFxAPI function call. Preinstalling a driver package copies the following files to the DIFx driver store: the INF file, the catalog file, and all the other files that are referenced by the INF file. Preinstalling a driver package also installs the driver package INF file in the system INF directory.

To preinstall a driver package, an installation application calls the DriverPackagePreinstall function, supplying the following information:

  • The fully qualified path of the INF file of the driver package to preinstall. For information about supplying an INF file path, see Specifying a Driver Package INF File.

  • Optional flag values that modify the default preinstall operation.

After a PnP driver package is preinstalled, if the driver is the best match for a device that is subsequently connected to a computer, Windows will install the driver for the device.

Preinstalling a driver package particularly helps if you want to do the following:

  • Perform a software-first installation of a driver package for a device before a user connects the device to a computer.

  • Install driver packages for the child devices of a multifunction device before the multifunction device is installed. If the driver packages for the child devices of the multifunction device are preinstalled, Windows will automatically install the driver packages from the DIFx driver store after the multifunction device is installed.

The default operation of DriverPackagePreinstall preinstalls a driver package only if the package complies with the DIFx driver package requirements. These requirements include, but are not limited to, the following:

  • General driver package requirements. For more information about general driver package requirements, see Creating a Driver Package and Device Installation Overview.

  • Driver packages must be signed with a Windows Hardware Quality Labs (WHQL) signature or a Microsoft Authenticode signature.

For a complete list of all driver package requirements, see DIFx Driver Package Requirements.

In addition to DIFx requirements, the default preinstall operation installs a driver package only if the package complies with the following rules:

  • The catalog file must be in the same directory as the INF file.

  • The driver package must not be missing any files.

  • The driver package must not be already preinstalled.

An installation application can modify the default preinstall operation by specifying flag values to do the following:

  • Preinstall a driver package only if the driver matches a device in the device tree, regardless of whether the driver package is a better match than the driver that is currently installed for the device.

  • Preinstall a driver package that is unsigned or that has missing files. However, the Windows driver signing requirements apply to the subsequent installation of the driver package from the DIFx driver store. These requirements depend on the Windows version, the signature type, the driver package type, and the driver signing options set for a computer. For more information about how DIFxAPI and Windows handle driver signing requirements, see DIFx Driver Package Requirements.

  • Preinstall a driver package only if the driver package matches a device in the device tree and the driver package is a better match than the driver package that is currently installed for the device.

  • Preinstall a driver package even if the driver package is already preinstalled.

  • Perform a quiet preinstall, also referred to as silent preinstall, which suppresses the wizard pages, user dialog boxes, and other user messages that DIFxAPI and Windows generate. If a user dialog box is required to continue a preinstall, for example, in response to a driver signing dialog box, the preinstall will fail without displaying a user message.

For examples of how to call DriverPackagePreinstall, see the following topics:

Perform a Default DIFxAPI Preinstall

Perform a DIFxAPI Preinstall Only for Matching Devices

Perform a Quiet DIFxAPI Preinstall

 

 

Send comments about this topic to Microsoft

显示:
© 2014 Microsoft