This document outlines the basic steps for installing a driver developed with version 11.9.0 or newer of WinDriver on a target Windows PC. Detailed driver distribution instructions can be found in the WinDriver User’s Manual for your WinDriver version.
The Windows driver distribution steps for version 8.0.x of WinDriver are outlined in Technical Document #130.
This document includes
- All OS references in this document are applicable only to WinDriver versions that officially support these operating systems (refer toTechnical Document #4 for the list of operating systems supported by the latest WinDriver version).
- The windrvr<version>.sys, windrvr<version>.inf, andwd<version>.cat files, mentioned in this document, can be found in the WinDriver\redist directory on the development PC.wdreg.exe / wdreg_gui.exe and difxapi.dll can be found in theWinDriver\util directory. (The source code of the wdreg utility is found in the WinDriver\samples\wdreg directory.)
- You can rename the WinDriver Windows driver module —windrvr<version>.sys (e.g., windrvr1200.sys) — and the related INF file — windrvr<version>.inf (e.g.,windrvr1200.inf). You can also submit the driver for Windows certification or have it Authenticode signed yourself, using your own WinDriver catalog file (xxx.cat), as explained in the WinDriver User’s Manual. If you have selected to rename any of the provided WinDriver files, replace the references to these files in the present document with the names of your new files.
- The wdreg.exe and wdreg_gui.exe utilities provide the same functionality. The difference is in the way the installation messages are displayed — graphical messages (wdreg_gui.exe) or console messages (wdreg.exe). You can therefore replace any reference to wdreg.exe in the following instructions with wdreg_gui.exe.
The wdreg utility is dependent on the difxapi.dll DLL.
- You must have administrative privileges in order to install drivers on Windows.
- When distributing your driver, take care not to overwrite a newer version of the driver file — windrvr<version>.sys or a renamed driver — with an older version of this file.
The provided INF file — windrvr<version>.inf (e.g.,windrvr1200.inf) — uses the
COPYFLG_NO_VERSION_DIALOGdirective, which is designed to avoid overwriting a file in the destination directory with the source file if the existing file is newer than the source file. There is also a similar
COPYFLG_OVERWRITE_OLDER_ONLYINF directive that is designed to ensure that the source file is copied to the destination directory only if the destination file is superseded by a newer version. Note, however, that both of these INF directives are irrelevant to digitally signed drivers. As explained in the Microsoft INF CopyFiles Directive documentation, if a driver package is digitally signed, Windows installs the package as a whole and does not selectively omit files in the package based on other versions already present on the computer. The WinDriver driver — windrvr<version>.sys — is digitally signed with an Authenticode signature (refer to the WinDriver User’s Manual for more information on driver signature and certification).
Since v11.9.0 of WinDriver, the default driver module name includes the WinDriver version (e.g., windrvr1200.sys for version 12.0.0), so if you do not rename the driver to a previously-used name there should not be conflicts with older drivers.
- If you wish to distribute drivers for both 32-bit and 64-bit target platforms, you must prepare a separate driver installation package for each platform.
- When upgrading the driver from a previous version of WinDriver, if your are using the same renamed driver, make sure that there are no open handles to the old WinDriver service, and that there are no connected and enabled Plug-and-Play devices that are registered with this service. This includes closing any applications that may be using the driver; uninstalling your old Kernel PlugIndriver (if you had created such a driver):
\> wdreg -name OLD_KP uninstall
and either disabling, uninstalling, or physically disconnecting any device that is registered to work with the WinDriver service.
1.Copy windrvr<version>.sys, windrvr<version>.inf, andwd<version>.cat (for the current version — windrvr1200.sys,windrvr1200.inf, and wd1200.cat) to the same directory.
- If you select to copy wd<version>.cat to a different location you will need to modify the
CatalogFileentry in the windrvr<version>.inf file to point to the location of the catalog file.
- You can also select not to distribute the wd<version>.catcatalog file, in which case you need to remove or comment-out the
CatalogFileline in the windrvr<version>.inf file. However, note that if you do so the installation will not utilize the driver’s Authenticode digital signature (see the WinDriver User’s Manual for more information).
2. Use the utility wdreg.exe to install WinDriver’s kernel module on the target computer:
\> wdreg -inf <path to windrvr<version>.inf> install
NOTE: Remember that wdreg requires the difxapi.dll DLL.
TIP: If you copy wdreg.exe and difxapi.dll to the same directory as windrvr<version>.sys and windrvr<version>.inf, you can simply run the following command from your installation directory in order to install the driver:
install_dir:] wdreg -inf windrvr<version>.inf install
3. If you have created a Kernel PlugIn driver (e.g., my_kp.sys), copy this driver to Windows drivers directory —%windir%\system32\drivers — and install it using the wdreg.exeutility:
\> wdreg -name MY_KP install
NOTE: The driver name is indicated without the *.sys extension.
4. For Plug-and-Play devices (PCI/USB): install the device INF file, which registers your device to work with thewindrvr<version>.sys service (normally this file is created using WinDriver’s DriverWizard utility).
You can use the wdreg.exe utility with the
install command to automatically install the INF file:
\> wdreg -inf <path to device.inf> install
You can also use the
preinstall wdreg.exe command to pre-install an INF file for a device that is not currently connected to the PC:
\> wdreg -inf <path to device.inf> preinstall
5. If your project uses the wdapi<version>.lib library (for examplewdapi900.lib) — as is the case for the sample and generated DriverWizard projects — you need to distribute the wdapi DLL:
- When distributing 32-bit applications/DLLs to 32-bit targetsOR when distributing 64-bit applications/DLLs to 64-bit targets: Copy WinDriver\redist\wdapi<version>.dll (e.g.,wdapi900.dll) to the target’s %windir%\system32directory.
NOTE: If you attempt to copy the 64-bit DLL to the
%windir%\system32 directory using a 32-bit installation program, you may find that the DLL file is actually copied to the 32-bit %windir%\sysWOW64 directory. The reason for this is that Windows x64 platforms translate references to 64-bit directories from 32-bit commands into references to 32-bit directories. You can avoid the problem by using 64-bit commands to perform the necessary installation steps from your 32-bit installation program. The system64.exeprogram, provided in the WinDriver\redist directory of the Windows x64 WinDriver distributions, enables you to do this.
- When distributing 32-bit applications to 64-bit targets: Rename the file WinDriver\redist\wdapi<version>_32.dllto wdapi<version>.dll (for example, renamewdapi900_32.dll to wdapi900.dll) and copy the renamed file to the target’s %windir%\sysWOW64 directory.
6. Copy your hardware-control application/DLL to the target and run it!