10.2. Windows Driver Distribution

  • All references to wdreg in this section can be replaced with wdreg_gui, which offers the same functionality as wdreg but displays GUI messages instead of console-mode messages.
  • If you have renamed the WinDriver kernel module (windrvr1260.sys), as explained in Section 11.2, replace the relevant windrvr1260 references with the name of your driver, and replace references to the WinDriver\redist directory with the path to the directory that contains your modified installation files. For example, when using the generated DriverWizard renamed driver files for your driver project, as explained in Section 11.2.1, you can replace references to the WinDriver\redist directory with references to the generated xxx_installation\redist directory (where xxx is the name of your generated driver project). Note also the option to simplify the installation using the generated DriverWizard xxx_install.bat script and the copies of the WinDriver\util installation files in the generated xxx_installation\redist directory, as explained in Section 11.2.1.
  • If you have created new INF and/or catalog files for your driver, replace the references to the original WinDriver INF files and/or to the windrvr1260.cat catalog file with the names of your new files (see the file renaming information in Sections 11.2.1 and  11.3.2).

Distributing the driver you created is a multi-step process. First, create a distribution package that includes all the files required for the installation of the driver on the target computer. Second, install the driver on the target machine. This involves installing windrvr1260.sys and windrvr1260.inf, and installing the specific INF file for your device.

Finally, you need to install and execute the hardware-control application that you developed with WinDriver. These steps can be performed using wdreg utility.

10.2.1. Preparing the Distribution Package

Prepare a distribution package that includes the following files.

If you wish to distribute drivers for both 32-bit and 64-bit target platforms, you must prepare separate distribution packages for each platform. The required files for each package are provided in the WinDriver installation directory for the respective platform.

  • Your hardware-control application/DLL.
  • windrvr1260.sys.
    Get this file from the WinDriver\redist directory of the WinDriver package.
  • windrvr1260.inf.
    Get this file from the WinDriver\redist directory of the WinDriver package.
  • windrvr1260.cat
    Get this file from the WinDriver\redist directory of the WinDriver package.
  • wdapi1260.dll (for distribution of 32-bit binaries to 32-bit target platforms or for distribution of 64-bit binaries to 64-bit platforms) or wdapi1260_32.dll (for distribution of 32-bit binaries to 64-bit platforms [A.2].
    Get this file from the WinDriver\redist directory of the WinDriver package.
  • difxapi.dll (required by the wdreg.exe utility [9.2.1]).
    Get this file from the WinDriver\util directory of the WinDriver package.
  • An INF file for your device.
    You can generate this file with DriverWizard, as explained in Section 5.2.

10.2.2. Installing Your Driver on the Target Computer

Driver installation on Windows requires administrator privileges.

Follow the instructions below in the order specified to properly install your driver on the target computer:

  • Preliminary Steps:
    To successfully install your driver, make sure that there are no open handles to the WinDriver service (windrvr1260.sys or your renamed driver [11.2]), and that there are no connected and enabled Plug-and-Play devices that are registered with this service. If the service is being used, attempts to install the new driver using wdreg will fail. This is relevant, for example, when upgrading from an earlier version of the driver that uses the same driver name. You can disable or uninstall connected devices from the Device Manager (Properties | Disable/Uninstall) or using wdreg, or otherwise physically disconnect the device(s) from the PC.

    Since v11.9.0 of WinDriver, the default driver module name includes the WinDriver version, so if you do not rename the driver to a previously-used name there should not be conflicts with older drivers.
  • Install WinDriver's kernel module:
    1. Copy windrvr1260.sys, windrvr1260.inf, and windrvr1260.cat to the same directory.


      windrvr1260.cat contains the driver's Authenticode digital signature. To maintain the signature's validity this file must be found in the same installation directory as the windrvr1260.inf file. If you select to distribute the catalog and INF files in different directories, or make any changes to these files or to any other files referred to by the catalog file (such as windrvr1260.sys), you will need to do either of the following:

      • Create a new catalog file and re-sign the driver using this file.
      • Comment-out or remove the following line in the windrvr1260.inf file:
        and do not include the catalog file in your driver distribution. However, note that this option invalidates the driver's digital signature.

      For more information regarding driver digital signing and certification and the signing of your WinDriver-based driver, refer to Section 11.3 of the manual.

    2. Use the utility wdreg to install WinDriver's kernel module on the target computer:
      wdreg -inf <path to windrvr1260.inf> install

      For example, if windrvr1260.inf and windrvr1260.sys are in the d:\MyDevice directory on the target computer, the command should be:
      wdreg -inf d:\MyDevice\windrvr1260.inf install

      You can find the executable of wdreg in the WinDriver package under the WinDriver\util directory. For a general description of this utility and its usage, please refer to Chapter 9.

      • wdreg is dependent on the difxapi.dll DLL.
      • wdreg is an interactive utility. If it fails, it will display a message instructing the user how to overcome the problem. In some cases the user may be asked to reboot the computer.
      When distributing your driver, you should attempt to ensure that the installation does not overwrite a newer version of windrvr1260.sys with an older version of the file in Windows drivers directory (%windir%\system32\drivers) — for example, by configuring your installation program (if you are using one) or your INF file so that the installer automatically compares the time stamp on these two files and does not overwrite a newer version with an older one. The provided windrvr1260.inf file uses the COPYFLG_NO_VERSION_DIALOG directive, 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_ONLY INF 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 — http://msdn.microsoft.com/en-us/library/ff546346%28v=vs.85%29.aspx — 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 windrvr1260.sys driver provided by Jungo is digitally signed (refer to Section 11.3 for more information).
  • Install the INF file for your device (registering your Plug-and-Play device with windrvr1260.sys):

    Run the utility wdreg with the install command to automatically install the INF file and update Windows Device Manager:
    wdreg -inf <path to your INF file> install

    You can also use the wdreg utility's preinstall command to pre-install an INF file for a device that is not currently connected to the PC:
    wdreg -inf <path to your INF file> preinstall

    If the installation fails with an ERROR_FILE_NOT_FOUND error, inspect the Windows registry to see if the RunOnce key exists in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion. This registry key is required by Windows Plug-and-Play in order to properly install drivers using INF files. If the RunOnce key is missing, create it; then try installing the INF file again.
  • Install wdapi1260.dll:
    If your hardware-control application/DLL uses wdapi1260.dll (as is the case for the sample and generated DriverWizard WinDriver projects), copy this DLL to the target's %windir%\system32 directory.
    If you are distributing a 32-bit application/DLL to a target 64-bit platform [A.2], rename wdapi1260_32.dll in your distribution package to wdapi1260.dll, and copy the renamed file to the target's %windir%\sysWOW64 directory.

    If you attempt to write a 32-bit installation program that installs a 64-bit program, and therefore copies the 64-bit wdapi1260.dll DLL to the %windir%\system32 directory, you may find that the 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.exe program, provided in the WinDriver\redist directory of the Windows x64 WinDriver distributions, enables you to do this.
  • Install your hardware-control application/DLL: Copy your hardware-control application/DLL to the target and run it!