4.2. WinDriver Installation Process

The WinDriver CD contains all versions of WinDriver for the supported operating systems. The CD's root directory contains the Windows version. The installation of this version will begin automatically when you insert the CD into the CD drive on your Windows development machine. The other versions of WinDriver are located in <OS> subdirectories (for example: Linux; Wince).

4.2.1. Windows WinDriver Installation Instructions

[Note]
Driver installation on Windows requires administrator privileges.
  1. Insert the WinDriver CD into your CD-ROM drive, or double-click the downloaded installation file — WD1140.EXE — and follow the installation instructions.
    [Note]
    When using the installation CD, wait a few seconds for the installation to begin automatically. If this does not happen, double-click the file WD1140.EXE in the CD, and click the Install WinDriver button.
  2. At the end of the installation, you may be prompted to reboot your computer.
[Note]
  • The WinDriver installation defines a WD_BASEDIR environment variable, which is set to point to the location of your WinDriver directory, as selected during the installation. This variable is used during the DriverWizard [5] code generation — it determines the default directory for saving your generated code and is used in the include paths of the generated project/make files.
  • 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.

The following steps are for registered users only:

To register your copy of WinDriver with the license you received from Jungo, follow these steps:

  1. Start DriverWizard: Start | Programs | WinDriver | DriverWizard.
  2. Select the Register WinDriver option from the File menu, and insert the license string you received from Jungo.
  3. Click the Activate License button.
  4. To register source code that you developed during the evaluation period, refer to the documentation of WDU_Init() [B.4.1].

4.2.2. Windows CE WinDriver Installation Instructions

4.2.2.1. Installing WinDriver CE when Building New CE-Based Platforms

[Note]
  • The following instructions apply to platform developers who build Windows CE kernel images using Windows CE Platform Builder or using MS Visual Studio 2005/2008 with the appropriate Windows CE plugin. The instructions use the notation 'Windows CE IDE' to refer to either of these platforms.
  • We recommend that you read Microsoft's documentation and understand the Windows CE and device driver integration procedure before you perform the installation.
  1. Modify the project registry file to add an entry for your target device:
    • If you select to use the WinDriver component (refer to Step 2), modify WinDriver\samples\wince_install\<TARGET_CPU>\WinDriver.reg (e.g., WinDriver\samples\wince_install\ARMV4I\WinDriver.reg).
    • Otherwise, modify WinDriver\samples\wince_install\project_wd.reg.
  2. For Windows CE 4.x–5.x only, you can simplify the driver integration into your Windows CE platform by following the procedure described in this step, before the Sysgen platform compilation stage.

    Note:

    • Developers who use Windows CE 6.x and higher should skip to the next step (Step 3).
    • This procedure provides a convenient method for integrating WinDriver into your Windows CE platform. If you select not to use this method, you will need to perform the manual integration steps described in Step 4 below, after the Sysgen stage.
    • The procedure described in this step also adds the WinDriver kernel module (windrvr6.dll) to your OS image. This is a necessary step if you want the WinDriver CE kernel file (windrvr6.dll) to be a permanent part of the Windows CE image (NK.BIN), which is the case if you select to transfer the file to your target platform using a boot disk. However, if you prefer to have the file windrvr6.dll loaded on demand via the CESH/PPSH services, you need to perform the manual integration method described in Step 4 instead of performing the procedure described in the present step.
    1. Run the Windows CE IDE and open your platform.
    2. From the File menu select Manage Catalog Items...., click the Import... button, and select the WinDriver.cec file from the relevant WinDriver\samples\wince_install\<TARGET_CPU> directory (e.g., WinDriver\samples\wince_install\ARMV4I). This will add a WinDriver component to the Platform Builder Catalog.
    3. In the Catalog view, right-click the mouse on the WinDriver Component node in the Third Party tree, and select Add to OS design.
  3. Compile your Windows CE platform (Sysgen stage).
  4. If you did not perform the procedure described in Step 2 above, perform the following steps after the Sysgen stage in order to manually integrate the driver into your platform. Note: If you followed the procedure described in Step 2, skip this step and go directly to Step 5.
    1. Run the Windows CE IDE and open your platform.
    2. Select Open Release Directory from the Build menu.
    3. Copy the WinDriver CE kernel file — WinDriver\redist\<TARGET_CPU>\windrvr6.dll — to the %_FLATRELEASEDIR% subdirectory on the target development platform (should be the current directory in the new command window).
    4. Append the contents of WinDriver\samples\wince_install\project_wd.reg to the %_FLATRELEASEDIR%\project.reg registry file.
    5. Copy the contents of the WinDriver\samples\wince_install\project_wd.bib file to the FILES section of the binary image builder file — %_FLATRELEASEDIR%\project.bib. Then uncomment the line that matches the target platform (see the "TODO" comments in the copied text).

      [Note]
      This step is only necessary if you want the WinDriver CE kernel file (windrvr6.dll) to be a permanent part of the Windows CE image (NK.BIN), which is the case if you select to transfer the file to your target platform using a boot disk. If you prefer to have the file windrvr6.dll loaded on demand via the CESH/PPSH services, you do not need to perform this step until you build a permanent kernel.
  5. Select Make Run-Time Image from the Build menu, and name the new image NK.BIN.
  6. Download your new kernel to the target platform and initialize it either by selecting Attach Device from the Target menu, or by using a boot disk. For Windows CE 4.x, the menu is called Download/Initialize rather than Attach Device.
  7. Restart your target CE platform. The WinDriver CE kernel will automatically load.
  8. Compile and run the sample programs to make sure that WinDriver CE is loaded and is functioning correctly (see Section 4.4.2, which describes how to check your installation).

4.2.2.2. Installing WinDriver CE when Developing Applications for Windows CE Computers

[Note]
Unless otherwise specified, 'Windows CE' references in this section include all supported Windows CE platforms, including Windows Mobile.

The following instructions apply to driver developers who do not build the Windows CE kernel, but only download their drivers, built using MS eMbedded Visual C++ or MS Visual Studio 2005/2008 to a ready-made Windows CE platform.

  1. Insert the WinDriver CD into your Windows host CD drive.
  2. Exit the automatic installation.
  3. Copy WinDriver's kernel module — windrvr6.dll — from the WinDriver\redist\WINCE\<TARGET_CPU> directory on the Windows host development PC to the Windows directory on your target Windows CE platform.
  4. Add WinDriver to the list of device drivers Windows CE loads on boot:
    • Modify the registry according to the entries documented in the file WinDriver\samples\wince_install\project_wd.reg. This can be done using the Windows CE Pocket Registry Editor on the hand-held CE computer, or by using the Remote CE Registry Editor Tool supplied with MS eMbedded Visual C++ or MS Visual Studio 2005/2008. Note that in order to use the Remote CE Registry Editor tool you will need to have Windows CE Services installed on your Windows host platform.
    • On many versions of Windows CE, the operating system's security scheme prevents the loading of unsigned drivers at boot time, therefore the WinDriver kernel module has to be reloaded after boot. To load WinDriver on the target Windows CE platform every time the OS is started, copy the WinDriver\redist\Windows_Mobile_5_ARMV4I\wdreg.exe utility to the Windows\StartUp directory on the target PC.
  5. Restart your target CE computer. The WinDriver CE kernel will automatically load. You will have to do a warm reset rather than just suspend/resume (use the reset or power button on your target CE computer).
  6. Compile and run the sample programs to make sure that WinDriver CE is loaded and is functioning correctly (see Section 4.4, which describes how to check your installation).

4.2.2.3. Windows CE Installation Note

The WinDriver installation on the host Windows 8 / 7 / Vista / Server 2008 / Server 2003 / XP PC defines a WD_BASEDIR environment variable, which is set to point to the location of your WinDriver directory, as selected during the installation. This variable is used during the DriverWizard [5] code generation — it determines the default directory for saving your generated code, and is used in the include paths of the generated project/make files.

Note that if you install the WinDriver Windows toolkit on the same host PC, the installation will override the value of the WD_BASEDIR variable from the Windows CE installation.

4.2.3. Linux WinDriver Installation Instructions

4.2.3.1. Preparing the System for Installation

In Linux, kernel modules must be compiled with the same header files that the kernel itself was compiled with. Since WinDriver installs kernel modules, it must compile with the header files of the Linux kernel during the installation process.

Therefore, before you install WinDriver for Linux, verify that the Linux source code and the file version.h are installed on your machine:

Install the Linux kernel source code:

  • If you have yet to install Linux, install it, including the kernel source code, by following the instructions for your Linux distribution.
  • If Linux is already installed on your machine, check whether the Linux source code was installed. You can do this by looking for 'linux' in the /usr/src directory. If the source code is not installed, either install it, or reinstall Linux with the source code, by following the instructions for your Linux distribution.

Install version.h:

  • The file version.h is created when you first compile the Linux kernel source code. Some distributions provide a compiled kernel without the file version.h. Look under /usr/src/linux/include/linux to see whether you have this file. If you do not, follow these steps:
    1. Become super user:
      $ su
    2. Change directory to the Linux source directory:
      # cd /usr/src/linux
    3. Type:
      # make xconfig
    4. Save the configuration by choosing Save and Exit.
    5. Type:
      # make dep
    6. Exit super user mode:
      # exit

To run GUI WinDriver applications (e.g., DriverWizard [5]; Debug Monitor [7.2]) you must also have version 5.0 of the libstdc++ library — libstdc++.so.5. If you do not have this file, install it from the relevant RPM in your Linux distribution (e.g., compat-libstdc++).

Before proceeding with the installation, you must also make sure that you have a linux symbolic link. If you do not, create one by typing
/usr/src$ ln -s <target kernel>/linux
For example, for the Linux 2.4 kernel type
/usr/src$ ln -s linux-2.4/ linux

4.2.3.2. Installation

If your development machine is running a Debian distribution (e.g., Ubuntu) or has the Red Hat Package Manager (RPM) utility (used, e.g., in Red Hat distributions such as Fedora), you can use the provided Debian or RPM WinDriver installation package (respectively) to automate the WinDriver installation, as outlined in Section 4.2.3.2.1. Otherwise, follow the manual installation process in Section 4.2.3.2.2, which is supported for all Linux distributions.

4.2.3.2.1. Installation using a Debian or RPM Installation Package

To install WinDriver using one of the Debian or RPM WinDriver installation packages, follow these steps:

  1. Insert the WinDriver CD into your Linux machine's CD drive, or copy the downloaded file to your preferred directory.
  2. Extract the relevant distribution package for your development machine from the WinDriver installation file — WD1140LN.tgz or WD1140LNx86_64.tgz:
    • Debian 32-bit — windriver-11.4.0-1.i386.deb
    • Debian 64-bit — windriver-11.4.0-1.x86_64.deb
    • RPM 32-bit — windriver-11.4.0-2.i386.rpm
    • RPM 64-bit — windriver-11.4.0-2.x86_64.rpm
  3. Use your selected package installer software to install the extracted package.
    [Note]
    • On most machines, *.deb files (Debian) and *.rpm files (RPM) are already associated with the relevant installation software, so you can simply double-click the package file and follow the installation instructions.
    • You may also install the package from the command-line, using root privileges — for example:
      • To install the 32-bit Debian package —
        # sudo dpkg -i windriver-11.4.0-1.i386.deb
      • To install the 64-bit RPM package —
        # sudo rpm -i --scripts windriver-11.4.0-2.x86_64.rpm

    The package installation will create a /usr/local/WinDriver product directory.

4.2.3.2.2. Manual Installation
  1. Insert the WinDriver CD into your Linux machine's CD drive, or copy the downloaded file to your preferred directory.
  2. Change directory to your preferred installation directory, for example to your home directory:
    $ cd ~
    [Note]
    The path to the installation directory must not contain any spaces.
  3. Extract the WinDriver distribution file — WD1140LN.tgz or WD1140LNx86_64.tgz
    $ tar xvzf <file location>/WD1140LN[x86_64].tgz

    For example, to extract WD1140LN.tgz

    • From a CD —
      $ tar xvzf /mnt/cdrom/LINUX/WD1140LN.tgz
    • From a downloaded file —
      $ tar xvzf ~/WD1140LN.tgz

  4. Change directory to your WinDriver redist directory (the tar automatically creates a WinDriver directory):
    $ cd <WinDriver directory path>/redist
  5. Install WinDriver:
    1. <WinDriver directory>/redist$ ./configure
      [Note]
      • The configuration script creates a makefile based on the running kernel. You may select to use another installed kernel source, by executing the script with the --with-kernel-source=<path> option, where <path> is the full path to the kernel source directory — e.g., /usr/src/linux.
      • If the Linux kernel version is 2.6.26 or higher, the configuration script generates makefiles that use kbuild to compile the kernel modules. You can force the use of kbuild on earlier versions of Linux, by executing the configuration script with the --enable-kbuild flag.
      [Note]
      For a full list of the configuration script options, use the --help option:
      ./configure --help
    2. <WinDriver directory>/redist$ make
    3. Become super user:
      <WinDriver directory>/redist$ su
    4. Install the driver:
      <WinDriver directory>/redist# make install
  6. Create a symbolic link so that you can easily launch the DriverWizard GUI:
    $ ln -s <path to WinDriver>/wizard/wdwizard /usr/bin/wdwizard
  7. Change the read and execute permissions on the file wdwizard so that ordinary users can access this program.
  8. Change the user and group IDs and give read/write permissions to the device file /dev/windrvr6, depending on how you wish to allow users to access hardware through the device. Due to security reasons, by default the device file is created with permissions only for the root user. Change the permissions by modifying your /etc/udev/permissions.d/50-udev.permissions file. For example, add the following line to provide read and write permissions:
    windrvr6:root:root:0666
  9. Define a new WD_BASEDIR environment variable and set it to point to the location of your WinDriver directory, as selected during the installation. This variable is used in the make and source files of the WinDriver samples and generated DriverWizard [5] code, and is also used to determine the default directory for saving your generated DriverWizard projects. If you do not define this variable you will be instructed to do so when attempting to build the sample/generated code using the WinDriver makefiles.
  10. Exit super user mode:
    # exit
  11. You can now start using WinDriver to access your hardware and generate your driver code!
[Tip]
Use the WinDriver/util/wdreg script to load the WinDriver kernel module [10.3].
4.2.3.2.3. Registering Your WinDriver License
[Note]
This section applies only to registered WinDriver users.

To register your copy of WinDriver with the license you received from Jungo, follow these steps:

  1. Start DriverWizard:
    $ <path to WinDriver>/wizard/wdwizard
  2. Select the Register WinDriver option from the File menu, and insert the license string you received from Jungo.
  3. Click the Activate License button.
  4. To register source code that you developed during the evaluation period, refer to the documentation of WDU_Init() [B.4.1].

4.2.3.3. Restricting Hardware Access on Linux

[Caution]

Since /dev/windrvr6 gives direct hardware access to user programs, it may compromise kernel stability on multi-user Linux systems. Please restrict access to DriverWizard and the device file /dev/windrvr6 to trusted users.

For security reasons the WinDriver installation script does not automatically perform the steps of changing the permissions on /dev/windrvr6 and the DriverWizard application (wdwizard).