Installing and Registering Device Drivers
Device drivers are executable files (SYS for Windows NT-based platforms and
VXD or WDM for Windows 9x) that interface between a hardware device and the
operating system. Installing a device driver requires two steps:
- Installation of the device driver executable file;
- Registration of the device driver with Windows.
The appropriate installation folder for device drivers is platform dependent.
However, if you place them in the Windows Volume\Windows\System32\Driver
folder, then Tarma Installer will automatically select the correct folder
for you. On Windows 9x, this folder resolves to the Windows System folder;
on Windows NT, it is the Drivers subfolder.
Be aware of the fact that most, if not all, device drivers themselves are platform
dependent in the same manner. To avoid installation or registration problems,
you should therefore mark each executable file for installation only on the
relevant platforms through the Platforms... setting of the file's component.
The net result is that the device driver or service will be installed and registered
when your application is installed, and unregistered and removed when your
application is uninstalled. All this is subject to the usual rules for file
installation; in particular, Tarma Installer will correctly handle updates
of existing copies of the file (based on a version check, if available) and
will only remove the device driver or service if no other applications use
it. This remains true even if the SharedDlls reference count of the
file is unreliable (as is often the case).
1. Installation of the device driver executable file
To add a device driver to your Tarma Installer project, act as follows.
- Go to the Features and Components project page.
- If you are installing one or more device drivers for Windows 95, 98, or
Me (VXD or WDM executables), then create a new component and call it Dev9x.
In the component's Component
attributes pane, click on Platforms... and clear all check
boxes except Windows 95, Windows 98, and Windows Me.
- If you are installing one or more device drivers for Windows NT, 2000,
XP, or later (SYS executables), then create a new component and call it
DevNT. In the component's Component
attributes pane, click on Platforms... and check all boxes
except Windows 95, Windows 98 , and Windows Me.
- Add the newly created components to at least one feature in the Features
tree. You can simply drag & drop each component to the desired feature.
- Go to the Files and
Folders project page.
- Add the device driver executable file as an installation file to the Windows
Volume\Windows\System32\Driver folder. If necessary, refer to Installing
Files for information about adding installation files to folders.
When asked in the Bulk
Import dialog box, select Assign to existing component and
choose Dev95 (for VXD and WDM files) or DevNT (for SYS files)
from the drop-down list.
Note: You can also change the file's component afterwards by right-clicking
on the file and choosing Assign to component.
-
Select the newly added file in the files list to display its settings
in the File
attributes pane, then check that the following options are set:
- Install action - Install if newer
- Remove action - Remove if installed
- Registration - Set to No self-registration.
- Shared file - checked
- Repeat steps 6-7 as required for other device drivers.
- On the Tarma Installer - Installer
Options project page, make sure that the Installation level
option is set to Administrator.
2. Registration of the device driver with Windows
To register a device driver with Windows, you must add certain keys and values
to the registry. There are two ways to do so:
Registry Keys and Values project page
This method works for both Windows 9x (VXD, WDM) and Windows NT-based (SYS)
device drivers.
- Start the Registry Editor (RegEdit.exe) on a system that has the
desired device driver already installed.
- Navigate to the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
registry key.
- Find and select the registry subkey that corresponds to your device driver.
- Choose File > Export... from the Registry Editor's main menu,
select Selected branch, and save the .reg file. You can use either
the Registration Files (*.reg) or the Win9x/NT4 Registration
Files (*.reg) format. We recommend using the former one.
- In your Tarma Installer project, go to the Registry
Keys and Values project page.
- Choose File > Import > Registry File... from the main menu
and open the file that you saved in step 4.
- When the the Bulk
Import dialog box, select Assign to existing component and
choose Dev95 (for VXD and WDM device drivers) or DevNT (for
SYS device drivers) from the drop-down list.
- The registry keys and values are now added to the Registry tree
on the Registry Keys
and Values project page, under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\...name....
You may want to clean up the keys and values somewhat; in particular,
you should delete the Enum subkey that may appear under the device
driver's registry key.
Services and Drivers project page
This method only works for device drivers on Windows NT, 2000, XP and later.
Furthermore, if your device driver requires non-standard startup attributes,
you might have to use the previous method after all.
- Go to the Services
and Drivers project page.
- Create a new Service item.
- In the Service
attributes pane, set Service name to the internal name of your
device driver and Type to Kernel Driver.
- Set the Executable file attribute to the name of the SYS file that
you added to the project earlier. You can click the ... (browse)
button to open the Select
Installation File or Folder dialog box that allows you to browse for
the file.
- Set the other attributes as required by your device driver. You may have
to run RegEdit.exe on your development system to see how the device
driver is registered.
- Right-click on the Service object, then choose Assign to Component
from the context menu and select the DevNT component.
- If desired, add a new ServiceControl item and set its attributes
as follows:
- Service name - the internal name of your device driver
- Install action - Start Service
- Remove action - Delete Service (this will also stop
the device driver)
- Right-click on the Service Control object, then choose Assign to Component
from the context menu and select the DevNT component.