Installing Drivers and Utilities without Rebooting
Updated: December 4, 2001
On This Page
The Microsoft Windows 2000 and Windows XP operating system includes significant enhancements to ensure greater reliability and availability. Among these enhancements is a greatly reduced need to reboot the system to complete administrative tasks such as installation of new hardware, device drivers, and application software.
Avoiding unnecessary reboots benefits original equipment manufacturers (OEMs) that preinstall drivers and applications on systems in a factory environment, and it benefits system administrators who perform script-based installations of software over corporate networks. It also ensures a better experience for end users who add new functionality to their systems.
Hardware manufacturers and application software developers should design their installation applications as described in this article so that it is not necessary to reboot the system to complete the installation.
For related information about entries that are written to Setupapi.log when the system prompts for reboot during device installation, see Debugging Unexpected Reboots During Windows 2000 Setup, available on Driver Testing.
For related information about how Windows File Protection prevents shared system files from being replaced by application or driver installation, see "Windows File Protection and Windows."
When Is It Necessary to Reboot?
Rebooting the system is rarely necessary when installing Plug and Play devices or software applications on systems running Windows 2000. This is true because of the following reasons:
This section describes the few circumstances under which it is acceptable to reboot the system during installation. It also lists many operations that required rebooting in earlier versions of Windows operating systems, but do not require rebooting in Windows 2000.
Circumstances that Require a Reboot
When installing a new hardware component or application, it is acceptable to reboot the system only in the following circumstances:
For information about how to support installation of a new display driver without reboot, see Tips for Specific Device Classes later in this article
Note: A system must be shut down to add or remove RAM. However, after the system has been powered up again, it is not necessary to reboot after Windows identifies the system change.
Circumstances that Do Not Require a Reboot
Driver and application installation programs should not force reboots related to any of the following configuration changes:
Note: The system will prompt for a reboot if any process has an open handle on a device. Therefore, applications, services, and drivers that have registered for target device notification should close open handles when they receive notification that the device is about to be removed.
For information, application and service programmers should see RegisterDeviceNotification in the Microsoft Platform SDK. Driver writers should see IoRegisterPlugPlayNotification in the Windows DDK.
Installing Third-Party Drivers Without Rebooting
This section provides guidelines for designing drivers, INFs, and custom installation applications to install drivers without rebooting the system.
Vendors should examine all installation routines to make sure they do not attempt to replace certain files with new files that have the same names, such as the following:
Driver INF Files
Driver INF files should not include a Reboot= or Restart= directive and should avoid setting certain flags in CopyFiles= directives, as described in this section.
Reboot= or Restart= directive. A [DDInstall] section in an INF file for a Plug and Play device should not include a Reboot= or Restart= directive. These directives are provided for compatibility with Windows 95/98 and should not be used for Windows 2000, Windows XP, and later versions of the operating system. If one of these entries is present, the operating system is forced to reboot when the device is installed, whether the reboot is necessary. Let the Plug and Play Manager determine whether the system needs to be rebooted rather than specifying these directives.
CopyFiles= directive. A CopyFiles= directive can use hexadecimal flags to control how (or whether) a particular source file is copied to the destination. The following flags influence whether the system prompts for a reboot as a result of copying the file:
For information about these and other INF directives, see "INF File Sections and Directives" in the Windows DDK.
Custom Device Installation Applications
A custom device installation application should not use RunOnce registry entries to launch setup programs because processing of such entries can occur at any time, not necessarily after an intervening reboot. In contrast, RunOnce entries that are created by an INF during device installation are run immediately, without an intervening reboot.
A custom device installation application should call the
UpdateDriverForPlugAndPlayDevices function to install a new device or update the driver for an existing device. The optional bRebootRequired parameter of UpdateDriverForPlugAndPlayDevices indicates the need for a reboot:
For information, see "Writing a Device Installation Application" in the Windows DDK.
Tips for Specific Device Classes
This section provides tips for avoiding unnecessary reboots when installing devices of certain classes.
Display Drivers. The Windows DDK provides a tool that allows driver developers to dynamically reload a display driver without rebooting. This tool, called Newdisp.exe, accelerates display driver testing during development by making reboots less necessary when updating display driver code. Newdisp.exe does not currently cause a video miniport to be reloaded; if a video miniport is changed, the system must be rebooted to install and test it.
For information, see "NewDisp: Dynamic Reload of a Display Driver" in the Windows DDK.
Network Drivers. Use INetCfgPnpReconfigCallback, so that a user will not be required to reboot the operating system to cause configuration changes to take effect in the driver. A notify object can call SendPnpReconfig within its implementation of the INetCfgComponentControl::ApplyPnpChanges method to send configuration information to the driver of the network component that owns the object. SendPnpReconfig provides the notify object with a possible mechanism to send data to the driver. Calling SendPnpReconfig is optional for the notify object but recommended to avoid requiring a user to reboot the operating system before configuration changes take effect.
For information, see "Configuring the Components Driver" in the Windows DDK.
Microsoft DirectMusic Synths. Implement a software synth in user mode, rather than kernel mode, to avoid reboots and gain other benefits.
For information, see "User Mode versus Kernel Mode" in the Windows DDK.
Installing Utilities and Applications Without Rebooting
See "Guidelines for Creating Side-by-Side Assemblies" in the Microsoft Platform SDK for information about how to install applications without rebooting.
Using Windows Installer
To install utilities and other software that might accompany a device driver, use Windows Installer, as described in the Microsoft Platform SDK.
The Microsoft Windows Installer can determine when a reboot of the system is necessary and automatically prompt the user to reboot at the end of the installation. For example, the installer automatically prompts for a reboot if it needs to replace any files that are in use during the installation.
Installation package authors can suppress reboots by using the InstallValidate action in sequence tables. If the InstallValidate action detects the installation of a file that is in use, it displays the Files In Use dialog box, giving users the opportunity to shut down the process using the file and avoid rebooting the system.
The InstallValidate action also logs information about the file. The verbose logging option (MsiEnableLog with INSTALLLOGMODE_VERBOSE) logs additional information, such as the reason the file was in use.
For information about how to suppress reboots when using Windows Installer, see "System Reboots" in the Platform SDK.
Hardware manufacturers and application software developers should design their products to avoid unnecessary reboots.
To avoid unnecessary reboots when installing a new hardware component:
To avoid unnecessary reboots when installing applications: