How To Install Windows Drivers With Software Applications: August 1, 2006
How To Install Windows Drivers With Software Applications: August 1, 2006
How To Install Windows Drivers With Software Applications: August 1, 2006
Abstract
Microsoft® Windows Vista™ provides enhanced support for both software-first and
hardware-first installations of driver packages that have accompanying software
applications. This paper describes best practices for installing driver packages that
include applications on the Microsoft Windows® family of operating systems.
This information applies for the following operating systems:
Microsoft Windows Vista
Microsoft Windows Server® 2003
Microsoft Windows XP
Microsoft Windows 2000
Future versions of this preview information will be provided in the Windows Driver
Kit.
The current version of this paper is maintained on the Web at:
http://www.microsoft.com/whdc/driver/install/app_drv.mspx.
References and resources discussed here are listed at the end of this paper.
Contents
Introduction..............................................................................................................................3
Methods for Installing Drivers with Applications.......................................................................3
Software-First Scenarios......................................................................................................4
Hardware-First Scenarios....................................................................................................4
Method 1: A Co-Installer that Launches an Application Installer.....................................4
Method 2: An Application that Is Integrated with the Driver Package.............................4
Method 3: A HardwareId INF Directive in Autorun.inf.....................................................5
Device Installation Process......................................................................................................5
Method 1 Process: A Co-Installer that Launches an Application Installer............................5
Software-First Scenario...................................................................................................5
Hardware-First Scenario.................................................................................................6
Driver Updates................................................................................................................6
Method 2 Process: An Application that Is Integrated with the Driver Package....................6
Software-First Scenario...................................................................................................6
Hardware-First Scenario.................................................................................................6
Driver Updates................................................................................................................7
Method 3 Process: A HardwareId INF Directive in Autorun.inf............................................7
Software-First Scenario...................................................................................................7
Hardware-First Scenario.................................................................................................7
Driver Updates................................................................................................................8
Implementing Installation Methods..........................................................................................8
Method 1 Implementation: A Co-installer that Launches an Application Installer................8
Implementing a Finish-Install Page.................................................................................8
Implementing a Finish-Install Action................................................................................9
Implementation Guidelines for Co-Installers...................................................................9
Method 2 Implementation: An Application that Is Integrated with the Driver Package.......10
Method 3 Implementation: A HardwareId INF Directive in Autorun.inf...............................10
Multifunction Devices.............................................................................................................11
How to Install Windows Drivers with Software Applications - 2
Resources..............................................................................................................................11
Disclaimer
This is a preliminary document and may be changed substantially prior to final commercial release of the
software described herein.
The information contained in this document represents the current view of Microsoft Corporation on the
issues discussed as of the date of publication. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot
guarantee the accuracy of any information presented after the date of publication.
This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES,
EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights
under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval
system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property
rights covering subject matter in this document. Except as expressly provided in any written license
agreement from Microsoft, the furnishing of this document does not give you any license to these
patents, trademarks, copyrights, or other intellectual property.
Unless otherwise noted, the example companies, organizations, products, domain names, e-mail
addresses, logos, people, places and events depicted herein are fictitious, and no association with any
real company, organization, product, domain name, email address, logo, person, place or event is
intended or should be inferred.
Microsoft, Win32, Windows, Windows Server, and Windows Vista are either registered trademarks or
trademarks of Microsoft Corporation in the United States and/or other countries.
The names of actual companies and products mentioned herein may be the trademarks of their
respective owners.
August 1, 2006
© 2006 Microsoft Corporation. All rights reserved.
How to Install Windows Drivers with Software Applications - 3
Introduction
Microsoft® Windows Vista™ provides enhanced support for both software-first and
hardware-first installations of driver packages that have accompanying software
applications. These enhancements, along with changes in the requirements for the
Windows Vista Logo Program for Hardware, enable hardware vendors to build
products that give customers a great user experience when they install device
drivers that come with applications. Hardware vendors can take advantage of these
changes to support both software-first and hardware-first installations.
Often, a customer installs the software for a new device before installing the
hardware. This is a software-first installation. Just as often, a customer who is eager
to use a new device ignores instructions and labels that the vendor places on the
device to guide the user to perform a software-first installation. Instead, the
customer installs the hardware before the software. This is a hardware-first
installation. Customers are equally likely to use either method, so vendors must
support both, which has been difficult in the past.
The Windows Vista logo program requirements allow device co-installers to invoke
other programs to install applications. Vendors can use this technique to
dramatically improve hardware-first installation scenarios, as described in this
paper.
Windows Vista implements new features that further improve the user’s experience:
• A co-installer can use finish-install actions to present a user interface
outside the Found New Hardware Wizard, which enables the co-installer to
implement a customized user interface or to launch Microsoft Internet Explorer
to download applications.
• A new INF directive, HardwareId, can be added to Autorun.inf to prevent
the Found New Hardware Wizard from running and allow AutoRun to run the
application installer first.
To help improve security, driver versioning, and corporate deployment of drivers,
Windows Vista introduces the driver store, which is a special storage location on the
user's computer in which Plug and Play saves drivers that have yet to be installed.
Although the driver store has no direct effect on the installation of drivers that have
accompanying applications, vendors might have to modify driver packages that
were created for previous versions of Microsoft Windows®. For example, on
Windows Vista, drivers are first copied to the driver store and then installed from
that location, instead of being installed directly from a CD, so a co-installer cannot
assume that the driver CD is still present when the co-installer runs. To avoid
problems such as this, vendors should modify their driver packages to use the
installation methods that are described in this paper because these methods work
together with the driver store.
This paper describes methods that vendors can use to implement driver installation
packages that support both software-first and hardware-first installation of driver
packages. For more information about device and driver installation in
Windows Vista, see "Resources" at the end of this paper.
August 1, 2006
© 2006 Microsoft Corporation. All rights reserved.
How to Install Windows Drivers with Software Applications - 4
Software-First Scenarios
All of the installation methods that are described in this paper use the Device
Installation Frameworks (DIFx) tools, DPInst and DIFxApp. Both tools install device
packages. DPInst is a standalone executable. DIFxApp is a Microsoft Windows
Installer (MSI) custom action that integrates with existing application installers that
use MSI.
For more information about the DIFx tools, see Device Installation Frameworks
Overview, which is listed in "Resources" at the end of this paper.
Hardware-First Scenarios
Vendors can choose from three methods to create good hardware-first installation
solutions, each with different advantages and disadvantages. Vendors should
choose the method that best suits their products.
August 1, 2006
© 2006 Microsoft Corporation. All rights reserved.
How to Install Windows Drivers with Software Applications - 5
Software-First Scenario
1. The user inserts a CD.
2. AutoRun launches the application installer.
3. The application installer installs the application and uses the DIFx tools to
preinstall INFs and drivers in the driver store.
August 1, 2006
© 2006 Microsoft Corporation. All rights reserved.
How to Install Windows Drivers with Software Applications - 6
Hardware-First Scenario
1. The user installs the hardware.
2. Windows downloads the driver from Windows Update and installs it by using its
co-installer.
3. At the end of the driver install process, the co-installer’s finish-install page or
finish-install action either launches the application installer or prompts the user
to download the application from the Web.
4. The application installer installs the application. The DIFx tools in the
application installer (which are used in software-first installs) detect that drivers
have already been installed and do nothing.
Implementations that use this method with a CD must also use a HardwareId
directive in an Autorun.inf file, as described in "Method 3: Implement the
HardwareId INF Directive in Autorun.INF," later in this paper. In this case, the
installation process proceeds as described in that section.
Driver Updates
1. Windows Update detects a new driver.
2. The user chooses to install the new driver.
3. Windows Update downloads the driver package, including the new co-installer,
and installs it as usual.
4. The new co-installer prompts the user to download the new version of the
application. If this is implemented as a finish-install action, the co-installer itself
can download and install the new application.
5. The new application installer updates the application. The DIFx tools in the
application installer, which are used for software-first scenarios, detect that
drivers are already installed and do nothing.
Software-First Scenario
1. The user inserts a CD.
2. AutoRun launches DPInst.
3. DPInst pre-installs the driver’s INF and all of its files, including the application
and its installer, into the driver store.
4. The user installs the hardware.
5. Plug and Play installs the drivers that are already in the driver store.
6. The co-installer’s finish-install page launches the application installer.
7. The application installer installs only the application.
Hardware-First Scenario
August 1, 2006
© 2006 Microsoft Corporation. All rights reserved.
How to Install Windows Drivers with Software Applications - 7
Implementations that use this method with a CD must also use a HardwareId
directive in an Autorun.inf file, as described in "Method 3: Implement the
HardwareId INF Directive in Autorun.INF," later in this paper. In this case, the
installation process proceeds as described in that section.
Driver Updates
1. Windows Update detects a new driver.
2. The user chooses to install the new driver.
3. Windows Update downloads the driver package, including the new application,
and installs it as usual.
4. The new co-installer launches the application installer.
5. The application installer updates only the application.
Software-First Scenario
1. The user inserts a CD.
2. AutoRun launches the application installer.
3 The application installer installs the application and uses the DIFx tools to
preinstall INFs and drivers in the driver store.
4. The user installs the hardware.
5 Plug and Play installs the drivers that are already in the driver store.
Hardware-First Scenario
1. The user installs the hardware.
2. The Found New Hardware Wizard runs and prompts the user for the CD.
3. The Found New Hardware Wizard looks for the HardwareId directive in
Autorun.inf on the CD. If it finds a match, The Found New Hardware Wizard
runs AutoRun,
4. AutoRun launches the application installer.
5. The application installer installs the application and uses the DIFx tools to install
drivers. If this implementation also uses a co-installer as described for
Methods 1 and 2 earlier in this paper, the co-installer detects that the
application has been installed already and takes no action.
6. When the application installer exits, the Found New Hardware Wizard
continues.
August 1, 2006
© 2006 Microsoft Corporation. All rights reserved.
How to Install Windows Drivers with Software Applications - 8
7. The Found New Hardware Wizard detects that the driver is already installed
and exits.
Driver Updates
Windows Update hosts only driver updates that have been signed by WHQL and
installs driver updates. A vendor must host application updates and provide a
mechanism for updating applications.
Vendors can implement a system for synchronizing application and driver versions
through their application install mechanism: When the application downloads an
update, it also downloads a driver package and uses the DIFx tools to update the
driver.
August 1, 2006
© 2006 Microsoft Corporation. All rights reserved.
How to Install Windows Drivers with Software Applications - 9
August 1, 2006
© 2006 Microsoft Corporation. All rights reserved.
How to Install Windows Drivers with Software Applications - 10
been removed, which is why it is important to avoid prompting the user for the CD.
For example, suppose a user performs a software-first installation, removes the CD,
and then plugs in the device. The co-installer is invoked only when the user plugs in
the device for the first time.
Important
If a co-installer launches Internet Explorer, it must launch it in Protected Mode,
which has features that protect users against malicious code. Failing to launch
Internet Explorer in Protected Node opens the user's system to malicious software
attacks because Internet Explorer is running as an administrator. (Finish-install
pages always run as an administrator.) To launch Internet Explorer in Protected
Mode, follow the instructions in Understanding and Working in Protected Mode
Internet Explorer, which is listed in "Resources" at the end of this paper.
A driver package that implements this method should also follow the additional
guidelines for co-installers that are described in "Implementation Guidelines for Co-
Installers," earlier in this paper.
Each pnp-id is the Plug and Play hardware ID for one device. The Plug and
Play hardware ID can be relatively generic (for example,
August 1, 2006
© 2006 Microsoft Corporation. All rights reserved.
How to Install Windows Drivers with Software Applications - 11
Multifunction Devices
Multifunction devices require several drivers. Each driver might have an associated
application, or all drivers might interact with a single application. Vendors with
multifunction devices should follow the guidelines in this section.
For devices that use a parent device to enumerate several child devices:
• The parent driver’s INF should use the CopyInf directive to copy all the
child device’s INFs to the driver store. This preinstalls all of the drivers in the
driver store by using a single action. For details about CopyInf, see “INF
CopyINF Directive” in the WDK documentation.
• For methods 1 and 2 described earlier in this paper, only the parent
device’s co-installer launches the application installer.
For composite devices in which all devices appear as peers:
• Do not rely on Windows to install devices in a particular order. There is no
guaranteed order in which peer devices are installed.
• Each INF must have a CopyInf directive that copies all other INFs to the
driver store.
• For methods that use a co-installer as described in methods 1 and 2 earlier
in this paper:
• If the multifunction device has a separate application for each
driver, then each of those drivers can have its own co-installer that installs
its associated application.
• If the multifunction device has only one application and all of the
drivers communicate with it, then each device must have a co-installer that
is associated with it and launches the application installer. When the co-
installer processes its DIF_NEWDEVICEWIZARD_FINISHINSTALL
request, it should check to see if the application has already been installed
and request a finish-install page or action only if the application is not
already installed. This avoids launching the application installer multiple
times.
Resources
Device and Driver Installation on WHDC
Driver Install Frameworks Tools
http://www.microsoft.com/whdc/driver/install/difxtools.mspx
August 1, 2006
© 2006 Microsoft Corporation. All rights reserved.
How to Install Windows Drivers with Software Applications - 12
August 1, 2006
© 2006 Microsoft Corporation. All rights reserved.