Technical Document #57

Technical Document #57        [Product Version: 5.0.5 and below]
Driver installation on Plug-and-Play systems (Windows 98/Me/2000/XP) — WinDriver version 5.0.5 and earlier

When installing a driver for Plug-and-Play (PnP) hardware (PCI/USB) on a PnP system (such as Windows 98/Me/2000/XP), using version 5.0.5 of WinDriver or earlier, you should install the wdpnp.sys PnP driver (formerly wdusb.sys) as the driver for your device, using an INF file.
You can use WinDriver's DriverWizard to create the INF file for your device, and the install it according to the directions that will be displayed in the DriverWizard (and are also found in the WinDriver User's Manual).

In addition, you need to have the WinDriver service running for hardware access. (This is required for all operating systems, not just PnP.) This service is supported by the windrvr.sys driver.
The program wdreg.exe is supplied for installing this service.

In version 5.2 of WinDriver, the windrvr.sys and wdpnp.sys files were combined into a single windrvr.sys driver file, which is installed on PnP systems via the installation of an INF file. Please refer to the Driver Distribution chapter of the updated WinDriver User's Manual for more details regarding the current driver distribution process.

You can arrange to have wdreg.exe run earlier through an Install Shield or similar application packager, before the driver is installed (see Technical Document #54 for more information on this).

However, for Microsoft Windows certification (WHQL), you may need to have the entire installation performed through an INF file. In that case you can arrange to have one of your custom installation programs launched by your INF file by using the RUN ONCE key as shown below. [Please note that the following is true for version 5.0.5 or earlier of WinDriver].

 RUNONCEKEYNAME = "software\microsoft\windows\ currentversion\runonce\setup"

mycustom.exe is your custom program that incorporates the code of wdreg.exe to install and start the WinDriver service.
For more information on wdreg.exe, see the "Dynamically Loading Your Driver" and the "Driver Distribution" chapters in the WinDriver User's Manual.

You can also choose to use a co-installer program on Windows 2000 (see the MSDN WEB site for more information on co-installers).

If you do not wish to run an application program in this way, you can set up your INF file to copy windrvr.sys to the system32\drivers directory, and make the WinDriver service Registry entries.
This is demonstrated below for Windows 2000:

  HKR,,FriendlyName,,%Foobar.SvcDesc% ; Human readable name
  "Start",0x10001,0x02 ;2= on boot, 3= on demand
  "ImagePath", ,"\SystemRoot\System32\drivers\windrvr.sys"

  [Foobar.CopyFiles.NT] ; Files to copy
    windrvr.sys,,,2 ; 2= user can't skip this file

Note that the WinDriver service will only be started after a reboot.
For Windows 2000/XP/98/Me you can force a reboot by adding the Reboot or Restart directive to your INF file in the Install section.


If you wish to avoid the reboot, you need to adopt one of the aforementioned methods (co-installer, SETUP\RUNONCE key, application installer).