Prepare a distribution package that includes the following files.
⚠ Attention: 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.
Mandatory Files
File |
Distribution using WinDriver (No Renaming) |
Distribution of a Renamed Driver |
Your hardware-control application/DLL. |
Your user application.
Note: The value you pass WD_DriverName() should be windrvr1640 . |
Your user application.
Note: The value you pass WD_DriverName() should be your renamed driver name. |
.sys |
WinDriver\redist\windrvr1640.sys |
<projectname>\<projectname>_installation\redist\<projectname>.sys |
.inf (driver) |
WinDriver\redist\windrvr1640.inf |
<projectname>\<projectname>_installation\redist\<projectname>_driver.inf |
.inf (device) |
Could be generated using DriverWizard |
<projectname>\<projectname>_installation\redist\<projectname>_device.inf |
.cat (for driver INF) |
WinDriver\redist\windrvr1640.cat |
Can be created using Inf2Cat (provided with WDK).
For information about Jungo’s Windows Digital Driver Signing Service contact us at:
[email protected]
Attention: The .cat file provided in <projectname>\<projectname>_installation\redist\<projectname>.cat is test signed and should NOT be distributed. |
Kernel Plugin Files
If you have created a Kernel PlugIn driver: Add your Kernel PlugIn driver — .sys to your distribution package.
WinDriver API
Add a copy of wdapi, based on your target platform:
Platform |
File Name |
Distribution using WinDriver (No Renaming) |
Distribution of a Renamed Driver |
32-bit binaries for x86 target platforms
64-bit binaries for x86_64 platforms |
wdapi1640.dll |
WinDriver\redist\wdapi1640.dll |
<projectname>\<projectname>_installation\redist\wdapi1640.dll |
32-bit binaries for x86_64 platforms |
wdapi1640_32.dll |
WinDriver\redist\wdapi1640_32.dll |
<projectname>\<projectname>_installation\redist\wdapi1640_32.dll |
64-bit binaries for ARM64 platforms |
wdapi1640_arm64.dll |
WinDriver\redist\wdapi1640_arm64.dll |
<projectname>\<projectname>_installation\redist\wdapi1640_arm64.dll |
Language Specific Files
The following subsections explain which language specific files to add to your distribution package.
Note: If your project is written in a language that is not specified in the following subsections, then there are no additional files you need to add to your distribution package.
C#.NET/VB.NET Distribution Package
If your user application is a C#.NET/VB.NET application/DLL you must also add:
Platform |
File Name |
Distribution using WinDriver (No Renaming) |
Distribution of a Renamed Driver |
32-bit binaries for x86 target platforms
64-bit binaries for x86_64 platforms |
wdapi_dotnet1640.dll |
WinDriver\lib\wdapi_dotnet1640.dll |
<projectname>\<projectname>_installation\lib\wdapi_dotnet1640.dll |
32-bit binaries for x86_64 platforms |
wdapi_dotnet1640_32.dll |
WinDriver\lib\wdapi_dotnet1640_32.dll |
<projectname>\<projectname>_installation\lib\wdapi_dotnet1640_32.dll |
C#.NET Core Distribution Package
If your user application is a C#.NET Core application/DLL you must also add:
Platform |
File Name |
Distribution using WinDriver (No Renaming) |
Distribution of a Renamed Driver |
32-bit binaries for x86 target platforms
64-bit binaries for x86_64 platforms |
wdapi_netcore1640.dll |
WinDriver\lib\wdapi_netcore1640.dll |
<projectname>\<projectname>_installation\lib\wdapi_netcore1640.dll |
32-bit binaries for x86_64 platforms |
wdapi_netcore1640_32.dll |
WinDriver\lib\wdapi_netcore1640_32.dll |
<projectname>\<projectname>_installation\lib\wdapi_netcore1640_32.dll |
64-bit binaries compiled on x64 platform for ARM64 platforms |
arm64\wdapi_netcore1640.dll |
WinDriver\lib\arm64\wdapi_netcore1640.dll |
<projectname>\<projectname>_installation\lib\arm64\wdapi_netcore1640.dll |
Java Distribution Package
If your user application is a Java application/DLL you must also add:
Platform |
File Name |
Distribution using WinDriver (No Renaming) |
Distribution of a Renamed Driver |
32-bit binaries for x86 target platforms
64-bit binaries for x86_64 platforms |
wdapi_java1640.dll
wdapi_java1640.jar |
WinDriver\lib\wdapi_java1640.dll
WinDriver\lib\wdapi_java1640.jar |
<projectname>\<projectname>_installation\lib\wdapi_java1640.dll
<projectname>\<projectname>_installation\lib\wdapi_java1640.jar |
64-bit binaries compiled on x64 platform for ARM64 platforms |
wdapi_java1640.dll
wdapi_java1640.jar |
WinDriver\lib\arm64\wdapi_java1640.dll
WinDriver\lib\arm64\wdapi_java1640.jar |
<projectname>\<projectname>_installation\lib\wdapi_java1640.dll
<projectname>\<projectname>_installation\lib\wdapi_java1640.jar |
Testing Machine Distribution Package
⚠ Attention: On Windows 10 or higher you must disable digital signature enforcement in order to install unsigned INF files generated by the DriverWizard, or enter test signing mode and create a WinDriver test certificate (using wdreg
) in order to install test signed INF files generated by the DriverWizard. See 17.3.4. Temporary disabling digital signature enforcement in Windows 10 and 17.3.5.3 How to Generate Test Signed INF Files in DriverWizard Code Generation?. Make sure that this was done prior to performing the following steps, otherwise they will not work.
If you are preparing a distribution package for a testing machine and you chose to enable test signed INF files in DriverWizard code generation, in addition to the files listed above, in order to install the test signed INF files, you must also add:
⚠ Attention: The following files are for development and testing use only and should NOT be distributed.
File Name |
Distribution using WinDriver (No Renaming) |
Distribution of a Renamed Driver |
.cer file of the certificate used to sign the INF |
Copy the .cer file used to sign the cat file, the default .cer file is:
WinDriver\WinDriver1640.cer |
<projectname>\<projectname>_installation\redist\<certificate_name>.cer |
install_test_cert.bat
uninstall_test_cert.bat |
|
<projectname>\<projectname>_installation\redist\install_test_cert.bat
<projectname>\<projectname>_installation\redist\uninstall_test_cert.bat |
.cat |
.cat file for device INF can be generated in the
Generate .INF file dialog |
<projectname>\<projectname>_installation\redist\<projectname>.cat
Note: The above catalog file contains a signature for both driver INF and device INF. |
For installing the test signed INF files on a testing machine, see Chapter 17.3.5.2.2 Steps for Installing Test Signed INF Files on a Testing Machine
Installing Your Driver on the Target Computer
⚠ Attention: All references to wdreg in the following section can be replaced with wdreg_gui, which offers the same functionality as wdreg but displays GUI messages instead of console-mode messages.
⚠ Attention: The wdreg.exe utility, included in the x64 version of WinDriver is different than the wdreg.exe utility included in the ARM64 version of WinDriver. To run the x64 version of wdreg.exe on an ARM64 platform, add the -compat flag to the cmmand.
⚠ Attention: wdreg.exe / wdreg_gui.exe can be found in the WinDriver\util directory.
Driver installation on Windows requires administrator privileges.
Follow the instructions below in the specified order to properly install your driver on the target computer:
Preliminary Steps
Close Open Handles to your Kernel Module
To successfully install your driver, make sure that there are no open handles to the WinDriver service (windrvr1640.sys
or your renamed driver <projectname>.sys
), 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.
This includes closing any applications that may be using the driver, uninstalling your old Kernel PlugIn driver (if you had created such a driver) and either disabling, uninstalling, or physically disconnecting any device that is registered to work with the WinDriver service. The command to uninstall old kernel plugins is as follows:
wdreg -name OLD_KP uninstall
⚠ Attention: Since version 11.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 any conflicts with older drivers.
How to Avoid Overwriting The Newest Version of your Kernel Module
When distributing your driver, you should attempt to ensure that the installation does not overwrite a newer version of windrvr1640.sys
with an older version of the file in the Windows drivers directory (windir%\system32\drivers)
. You can do this by, for example, 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 windrvr1640.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
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 — https://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.
Install WinDriver’s Kernel Module or your Renamed Kernel Module
Copy the following files to the same directory.
File |
Distribution using WinDriver (No Renaming) |
Distribution of a Renamed Driver |
.sys |
WinDriver\redist\windrvr1640.sys |
<projectname>\<projectname>_installation\redist\<projectname>.sys |
.inf (driver) |
WinDriver\redist\windrvr1640.inf |
<projectname>\<projectname>_installation\redist\<projectname>_driver.inf |
.cat (for driver INF) |
WinDriver\redist\windrvr1640.cat |
If the package is for distribution: You can create this file using Inf2Cat (provided with WDK).
If the package is for testing: <projectname>\<projectname>_installation\redist\<projectname>.cat
Attention: The .cat file provided in <projectname>\<projectname>_installation\redist\<projectname>.cat is test signed and should NOT be distributed. |
⚠ Attention
windrvr1640.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
windrvr1640.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 windrvr1640.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
windrvr1640.inf
file:
CatalogFile=windrvr1640.cat
and not include the catalog file in your driver distribution. However, note that this option invalidates the driver’s digital signature.
Use the utility wdreg.exe to install WinDriver’s kernel module on the target computer:
wdreg -inf install
For example, if windrvr1640.inf and windrvr1640.sys are in the d:\MyDevice directory on the target computer, the command should be:
wdreg -inf d:\MyDevice\windrvr1640.inf install
You can find the executable of wdreg in the WinDriver package under the WinDriver\util directory.
⚠ Attention: 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.
Note: The windrvr1640.sys driver provided by Jungo is digitally signed.
Install the INF file for your device
Install the INF file for your device (registering your Plug-and-Play device with windrvr1640.sys):
Run the utility wdreg with the install command to automatically install the INF file and update the Windows Device Manager:
wdreg -inf [path to your device 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 device 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 your Kernel PlugIn
Driver installation on Windows requires administrator privileges.
If you have created a Kernel PlugIn driver, follow the additional instructions below:
- Copy your Kernel PlugIn driver (
<KP driver name>.sys
) to Windows drivers directory on the target computer (%windir%\system32\drivers
).
- Use the utility
wdreg.exe
to add your Kernel PlugIn driver to the list of device drivers Windows loads on boot. Use the following installation command to install a SYS Kernel PlugIn Driver:
wdreg -name [Your driver name, without the *.sys extension] install
You can find the executable of wdreg in the WinDriver package under the WinDriver\util directory.
⚠ Attention: The wdreg.exe utility, included in the x64 version of WinDriver is different than the wdreg.exe utility included in the ARM64 version of WinDriver. To run the x64 version of wdreg.exe on an ARM64 platform, add the -compat flag to the cmmand.
Install the WinDriver API
If your hardware-control application/DLL uses wdapi1640.dll
(as is the case for the sample and generated DriverWizard WinDriver projects), copy this DLL to the target’s shared library directory, according to the application/target platform as shown in the table:
Platform |
File from Distribution package (No Renaming) |
Destination on Target |
32-bit applications/DLLs for x86 targets
64-bit applications/DLLs for x86_64 targets |
wdapi1640.dll |
%windir%\system32 |
32-bit applications/DLLs for x86_64 targets |
wdapi1640_32.dll |
%windir%\sysWOW64 |
64-bit applications/DLLs compiled on ARM64 or x64
platform for ARM64 targets |
wdapi1640_arm64.dll |
%windir%\system32 |
⚠ Attention: If you attempt to write a 32-bit installation program that installs a 64-bit program, and therefore copies the 64-bit wdapi1640.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!
Redistribute Your WinDriver-based package as a self-extracting EXE
Starting from WinDriver version 14.3, WinDriver supports creation of NSIS installers for Windows for your generated code and user applications, via a CMake Project compiled on Visual Studio 2019 or higher.
Note: For further debugging or troubleshooting of driver installation issues, refer to windir%/INF/setupapi.dev.log
The Installer
What the Installer does:
- Packs your driver and your user application into a single self-extracting EXE file.
- Installs the user application files to the target computer.
- Installs the driver package (INF files) to the target computer using the
wdreg
utility.
- Provides the user with an uninstall EXE file that removes the user application and the driver from the target computer.
This allows to save users precious time in manually creating a redistribution package.
Requirements
Make sure Visual Studio 2019 or higher is installed along with the “C++ CMake Tools for Windows” and “Desktop development with C++” components installed.
As the next step, please make sure NSIS is installed if you haven’t already installed it on your development machine. If it is not, you can download it from the NSIS website. Make sure that the PATH environment variable includes the path to makensis.exe. This can be done the following way:
- In the Start Menu type
Edit the system environment variables
, this will open the System Properties
Window.
- Click the Environment Variables… button.
- Edit the
Path
Variable and make sure it includes the path to MakeNSIS.exe
(e.g. C:\Program Files\NSIS
)
Editing Environment Variables

Instructions
Follow these steps:
- From the DriverWizard code generation window – check the CMake Makefile (With NSIS Installer Generator) Checkbox.
WinDriver Code Generation Window

- In your generated code directory for your driver (
xxx
will be the driver name in this tutorial) found in WinDriver\wizard\my_projects\xxx
you should find a CMakeLists.txt
file.
- Open Visual Studio 2019 or higher.
- Go to File | Open | CMake and choose
WinDriver\wizard\my_projects\xxx\CMakeLists.txt
.
- After all background tasks are complete you will be able to change Solution Explorer to the CMake Targets View from the Switch Views icon in the Solution Explorer.
Changing to CMake Targets View
The CMake Targets View
- In order to start preparing your distribution package – you must compile it in Release configuration.
- In order to redistribute your driver – edit
xxx_lib.c
such that XXX_DEFAULT_LICENSE_STRING
will be defined to be your license string, and that XXX_DEFAULT_DRIVER_NAME
will be defined to be your renamed driver name (in this case xxx
). If you do not perform this step your user application might work on your development computer but will not work on the target computer.
License String replacement in code
- Build the project by right clicking xxx Project | Build All from the Solution Explorer. You should find a compiled
xxx.exe
file of your generated code in
WinDriver\wizard\my_projects\xxx\out\build\(PLATFORM_NAME)\WIN32
and an additional installer EXE file xxx_1.0.0-win64.exe
in WinDriver\wizard\my_projects\xxx\out\build\(PLATFORM_NAME)
.
Jungo recommends using the installer EXE file for distributing your driver package.
- Feel free to modify the
CMakeLists.txt
file to better suit for your needs.
⚠ Attention: Before installing the driver on a Windows-based target machine, either digitally sign the driver or disable Digital Signature enforcement. In addition, make sure to run the installer EXE as Administrator to make sure it has privileges to install drivers. Failure to do so might result in the driver not being installed properly on the target machine.