AN335
USB D
RIVER
I
N S TAL LA T IO N
M
ETHODS
1. Introduction
Users can install a driver for a Silicon Labs USB Device in three ways:
Driver Package Installer (DPInst)
Legacy Silicon Labs USB Driver Installer
INF-only installation
DPInst is an installation utility available through Microsoft. Silicon Labs redistributes this installer with the CP210x
and USBXpress drivers and provides a Driver Customization Utility (see application note, “AN220: USB Driver
Customization”) that will automatically customize a DPInst-based installation utility.
The Legacy Silicon Labs Driver installer is a utility included in the software accompanying this document. The
executable and INI files included with the installer are intended to be used as a template for a custom driver
installation utility. Running the executable alone will not install a driver, as the setup.ini file must be modified to work
with the driver installation. Both the INI and EXE files need to be moved into the driver installation directory next to
the INF file for the installation to be successful. See “4. Legacy Silicon Labs USB Driver Installer/Uninstaller” for
more information on usage and customization.
The INF-only installation doesn’t require any installer and simply relies on the INF file itself.
The following sections will describe each of these installation methods in more detail.
Note:
The WHQL recertification process that Silicon Labs provides to customers does not rely on any of these installation
methods, so they can be chosen, or changed, at any point in the process: during, before or after certification of a driver.
Microsoft’s
2. Relevant Documentation
Application notes can be found on the
www.silabs.com/interface-appnotes
and
www.silabs.com/8bit-appnotes
pages.
AN220:
USB Driver Customization
– This document describes the options available for generating a
customized DPInst utility with application-specific strings, VID, PID, and features. This application note
also includes a software utility to generate the customized DPInst files.
3. DPInst
DPInst is Microsoft’s utility that simplifies and customizes driver installations for Windows. Visit MSDN and read the
Driver Package Installer (DPInst) article for full details and support information on the DPInst utility:
http://
msdn.microsoft.com/en-us/library/windows/hardware/ff544842(v=vs.85).aspx.
3.1. Installation and Customization
The simplest method to install a driver with DPInst is to copy the
dpinst.exe
file to the same folder as the driver INF
file. It will run out of the box and uses the INF file to determine what to show in the dialogs and how to install the
driver. There are specific versions for DPInst, and Silicon Labs only uses x86 and x64. The
dpinst.exe
filename
itself can be modified and customized.
By creating and modifying a file named
dpinst.xml,
customization settings can be defined for the installation. For
more information on this, visit MSDN and read the Customizing Driver Installation article:
http://
msdn.microsoft.com/en-us/library/windows/hardware/ff540241(v=vs.85).aspx.
Rev. 0.4 5/14
Copyright © 2014 by Silicon Laboratories
AN335
AN335
3.1.1. Quiet Mode
It is common for manufacturers to launch an installer in quiet mode. To do this, create or modify an XML file as
described on MSDN. Command-line arguments to
dpinst.exe
can be used instead of the XML file, if desired. The
specific arguments to use are the suppressWizard (/sw), suppressEulaPage(/se) and quietInstall (/q) arguments.
The sample DPInst XML file would look like:
<dpinst>
...
<quietInstall/>
<suppressWizard/>
<suppressEulaPage/>
...
</dpinst>
The same functionality in command-line form is:
<dpinst install name>.exe /q /se /sw
3.1.2. Ignoring Serial Numbers
DPInst does not have a method to ignore serial numbers. This is a feature specific to the Legacy Silicon Labs
Installation Utility. To continue to use this option, refer to “4. Legacy Silicon Labs USB Driver Installer/Uninstaller” .
3.1.3. Using DPInst in XP with Unsigned Drivers
When using the DPInst installer with unsigned drivers, it is necessary to specify the legacyMode (/lm) argument
either in the
dpinst.xml
file or to
dpinst.exe
through the command line. This argument allows DPInst to install the
unsigned driver to the machine. The 64-bit drivers still need a signature to be able to be installed, with or without
this argument.
The sample DPInst XML file would look like:
<dpinst>
...
<legacyMode/>
...
</dpinst>
The equivalent operation on the command-line is:
<dpinst install name>.exe /lm
3.1.4. Further Customization
For additional information on other DPInst customization options, visit MSDN and read the Customizing Driver
Installation article:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff540241(v=vs.85).aspx.
Currently,
Silicon Labs offers automated customization of a
dpinst.xml
file when using the AN220 utility to generate a driver
installer. All the custom driver information is entered into this utility, and it will generate the
dpinst.xml
file in the
newly created driver package.
3.2. Uninstallation
DPInst will create an uninstaller in Control Panel’s Add/Remove Program Files on a successful installation. This
entry will be begin with
Windows Driver Package.
To uninstall a DPInst package, find the name of the driver in the
list and double-click to begin the uninstallation process.
Figure 1. Uninstalling the DPInst Driver Package
2
Rev. 0.4
AN335
4. Legacy Silicon Labs USB Driver Installer/Uninstaller
4.1. Description
The legacy driver installer and uninstaller combination is a template for a customizable installation utility for Silicon
Laboratories USB drivers. These utilities are completely independent of the actual driver, and no referencing is
done by the INF file to the installer or uninstaller. This is desirable because certification of the driver is not affected
by changes in the installation utility, and the installation utility is not required by the driver if a customer does not
want to use it. The utilities currently work under Windows 2000®, XP®, Server 2003®, Vista®, and Windows 7®.
4.2. Installation
The following sections explain how installation works using the Silicon Labs USB Driver Installer. This utility is no
longer updated by Silicon Labs, but it is made available for specific features, such as the “Manufacturing Ignore
Serial Numbers” option during install.
4.2.1. Install Package
The driver installer is built as a single executable that references a file called setup.ini. This INI file contains all of
the settings used for driver installation and uninstallation. This
DriverInstaller.exe
and
setup.ini
combination
should exist in a directory alongside the
*.sys
driver files,
*.inf
installation files, and (if the driver is certified) any
*.cat
catalog files. For example, the USBXpress Driver Package using this installer looks like this:
\USBXpressInstaller.exe (renamed DriverInstaller.exe)
\setup.ini (customized setup values)
\x64\SiUSBXp.sys (USBXpress driver 64 bit)
\x64\SiLib.sys (support library for USBXpress 64 bit)
\x86\SiUSBXp.sys (USBXpress driver 32 bit)
\x86\SiLib.sys (support library for USBXpress 32 bit)
\SiUSBXp.inf (INF file for the USBXpress driver)
\SiUSBXp.cat (catalog file for the USB driver)
When the
USBXpressInstaller.exe
executable runs, it starts by reading in all the values from the
setup.ini
file.
From this, it can determine if setup should be performed quietly or if the windows and message boxes should be
shown. If quiet mode is selected, then the installation routine begins immediately, and no status messages are
shown to the user. If quiet mode is not selected, the main window is populated with the strings specified in the INI
file (company name, product name, the driver version, etc.) and displayed to the user.
4.2.2. Installation Directory Selection
An option in the
setup.ini
file determines if drivers should be copied to the PC. If driver files are supposed to be
copied to the hard drive, then a default installation directory specified in
setup.ini
is displayed in the DriverInstaller
window. This directory can be changed by clicking the
Change Install Location
button. The installation directory is
where the driver package is copied and where the installation originates. With this type of setup, the original install
media, such as a CD or floppy, is not needed every time a device is installed.
The DriverInstaller can also take a default directory from the command line, which will override the default directory
for installation and forces the driver files to be copied regardless of the copy files specification in
setup.ini.
The
following is an example of how to pass in an installation directory:
USBXpressInstaller.exe “C:\Program Files\Silicon Labs\USBXpress”
If the
setup.ini
file specifies that driver files should not be copied to the PC, then no installation directory is shown
in the window and nothing will happen if a directory is supplied at the command line. Because nothing is copied,
the install media (such as a CD, floppy, or the source install directory on the PC) is where the installation originates
and will be needed when devices are plugged in. If the installation media is not found when a device is plugged in,
then the Add New Hardware Wizard will prompt for the disc or floppy. It is recommended to always copy the drivers
to the PC under
root:\Program Files\Company Name\Product Name
to avoid this behavior.
Rev. 0.4
3
AN335
4.2.3. Pre-Installation Routine
When the install button is clicked, the installer goes through a process to make sure that the driver is installed
successfully and cleanly. The steps are as follows:
Pre-installation
Checks
check
that a current version of the driver is not already installed.
Checks that an older version of the driver is not installed.
Checks that a version of this driver is not installed using an older version of Silicon Labs driver installation utilities.
Performs a system scan to ensure that other INF files do not exist with any VID and PID of the drivers that are about
to be installed.
The first check determines whether the driver being installed is already installed. If it is installed, it prompts and
exits. The next check determines if an older version of this driver was installed previously. If so, it will perform a
proper removal before installing the new driver. There is also a check to determine if this type of driver was
installed using one of Silicon Labs’ older installation utilities by looking up the uninstall keys in the registry. If it finds
an old version installed, it prompts the user to uninstall the old installation and runs the old uninstaller utility in quiet
mode.
Finally, the INF directory is scanned to find any leftover INF files that contain a matching VID and PID to the ones
being installed. If they are found, the user is prompted with the names of the driver sets and can choose to either
uninstall them and continue or cancel the installation.
During any of these preinstall checks, it is possible that something may occur that requires a reboot. If this is the
case, then the user is prompted to reboot at the end of the successful installation.
4.2.4. Driver Installation Routine Description
Driver
Driver
Installation (upon successful pre-installation check)
files are copied to the installation directory (if specified in setup.ini).
The uninstaller is copied into the system directory.
INF files are installed from either the installation directory (if copied) or the install media.
Registry entries are created for Driver Uninstallation.
Registry entries are created containing information on the current installation, such as the version, VID, PID,
DriverInstaller version, installation directory, and lists of files copied and installed. It also contains the options for
uninstallation, such as quiet, removing the installed driver files, etc.
The driver installation process is very straightforward. If anything fails in the above routine list, the user is prompted
and the application exits. If there are no errors, then the installation prompts with success and exits.
4.2.5. Driver Installation Completion
The driver installer records all device installation in a registry key. This key can be checked by calling the
application to determine if an installation has been completed successfully and comes from the first item in the
VID_PID List. See “4.4. Customization of the Driver Installer” for more information.
HKEY_LOCAL_MACHINE\SOFTWARE\Silicon
Laboratories,
Installations\<Device Type>\<Device Specific Key>
Inc.\Silicon
Laboratories
Driver
<Device Type>—The devices are split into USBXpress or VCP device types with a corresponding registry key of
“USBXpress” and “VCP CP210x Cardinal”, respectively.
<Device Specific Key>—USBXpress devices consist of device string
SIUSBXP&VVVV&PPPP
and CP210x
devices consist of device string
IIIICOMM&VVVV&PPPP
(where IIII is up to the first 4 characters in the INF file
name, VVVV is the VID and PPPP is the PID). These device specific keys are also used in the Windows Uninstaller
registry key which causes the driver installation to appear in the Add\Remove Programs listing.
The following registry entries are examples of the current USBXpress and VCP installations:
USBXpress—HKEY_LOCAL_MACHINE\SOFTWARE\Silicon
Installations\USBXpress\SIUSBXP&10C4&EA61
Laboratories,
Inc.\Silicon
Laboratories
Driver
4
Rev. 0.4
AN335
VCP—HKEY_LOCAL_MACHINE\SOFTWARE\Silicon
Laboratories,
Installations\VCP CP210x Cardinal\SLABCOMM&10C4&EA60
Inc.\Silicon
Laboratories
Driver
There may be times when an installation completes and the system needs to be rebooted. The user will be
prompted if the driver installer is not running in quiet mode. If the driver installer is being called from another
application in quiet mode, it is recommended to reboot the computer at the end of a successful installation.
4.3. Uninstallation
This section explains the Legacy Silicon Labs Driver uninstallation process.
4.3.1. Calling the Uninstaller
An uninstaller is copied to a
Silabs
directory inside the Windows system directory (such as
C:\Windows\system32\Silabs\).
This uninstaller is named
DriverUninstaller.exe
and is embedded within the
DriverInstaller.exe.
Because this is a universal installation utility, the same
DriverUninstaller.exe
is used by any
Silicon Labs driver installations. During installation, the installer checks the version of the current uninstaller (if it
already exists on the system) and then only replaces it if it is missing or an older version exists.
The uninstaller takes in the <Device Type>\<Device Specific Key> portion of the registry key entered at the
completion of an installation via command line. For example, to uninstall the USBXpress device with VID 0x10C4
and PID 0xEA61, the command would look like:
DriverUninstaller.exe “USBXpress\SIUSBXP&10C4&EA61”
The uninstaller is then provided with all of the installation information that was provided in the
setup.ini
file. When
the uninstaller first runs, it will look to see whether it should run in quiet mode. If so, the uninstallation is performed
with no windows or messages. If it is not in quiet mode, it will populate the window with all of the strings that were
specified in the
setup.ini
on installation and, if driver files were copied, will show their current existing location.
4.3.2. Driver Uninstallation Routine
First, the uninstaller removes the copied drivers if they are specified to be removed. If no drivers were copied on
installation in the first place, this check is skipped.
Next, the INF files for the device are uninstalled; this happens differently depending on the operating system. The
basic removal routine is to remove any INF/PNF combinations and then remove any catalog files (catalog files will
only be pertinent on Windows XP
®
/Server 2003
®
/Vista/7
®
).
Finally, the computer is scanned for any device reference to the driver, and those devices are removed from the
system. This causes any matching USB devices to be stopped, and they will not be recognized by the system until
they are either unplugged and plugged back in or a
Scan for New Hardware
command is issued in Device
Manager.
Rev. 0.4
5