Export (0) Print
Expand All

Running Finish-Install Actions

Prior to Windows 8, if a device is flagged as needing to perform a finish-install action, Windows initially attempts to complete the finish-install actions by running a finish-install process at one of the following times:

  • For a device that is installed during Windows setup, the first time that an administrator logs on to Windows after Windows setup is finished.

  • For a device that is installed or reinstalled after Windows is installed, after the core device installation operations have completed, as follows:
    • For a hardware-first installation of a device, Windows runs the initial finish-install process. If the current user is not an administrator, Windows will first prompt the user to enter the credentials of an administrator before it runs the initial finish-install process.

    • For a software-first installation of a device, Windows runs the initial finish-install process in the context of the administrator who initiated the installation or reinstallation.

In Windows 8 and later versions, finish-install actions are not automatically run as part of device installation, and the SetupDiFinishInstallAction function has been removed. Instead, they must be manually initiated by a user in an administrator context. For example, if a user plugs in a device that installs a driver that includes a finish-install action, the finish-install action will not automatically run at that time. Instead, the finish-install action will run at some later point when the user manually initiates it. An administrator (or a limited user that can provide administrator credentials to a UAC prompt) must go to the Action Center and address the "Finish installing device software" maintenance item in order for the finish-install action to be run. Until then, the finish-install action will not run. Thereafter, when Windows runs the finish-install action, it has that single opportunity to run. If it fails then it must take appropriate action to make sure to allow the user to try again and finish later. Similarly, installing supporting software that should accompany a driver can still be accomplished with a finish-install action, but it will not be installed automatically.

Thereafter, if the initial attempt to complete the finish-install actions succeeds, the finish-install process clears the device as being flagged to perform a finish install action. If the initial attempt to complete the finish-install actions fails, the finish-install process does not clear the device as being flagged to perform a finish install action and exits. Subsequently, while the device remains flagged to perform a finish install action, Windows repeatedly attempts to complete the finish-install actions by running a new finish-install process whenever the device is enumerated, as follows:

  • While the device remains installed, the next time an administrator logs on.

  • If an administrator clicks Scan for hardware changes on the Action menu of Device Manager or an installation program calls CM_Reenumerate_DevNode in the context of an administrator.

Thereafter, if the device is flagged to perform a finish-install action, the finish-install process calls SetupDiCallClassInstaller to send a DIF_FINISHINSTALL_ACTION request to installers for the device.

If an installer has finish-install actions, the installer performs finish-install actions and returns an appropriate error code for the DIF_FINISHINSTALL_ACTION request. An installer returns one of the error codes in the following table.

Error codeMeaning

ERROR_DI_DO_DEFAULT

Class installer: The class installer has successfully run its finish-install actions and is requesting that Windows perform its default processing.

The class installer also returns this error code if it has no finish-install actions, or a finish-install action fails and should not be attempted again.

Device or class co-installer: Co-installers do not return this error code.

NO_ERROR

Class installer: The class installer has successfully run its finish-install action. Windows should not perform its default processing.

Device or class co-installer: The co-installer has either successfully run its finish-install actions or has no finish-install actions.

The co-installer also returns this error code if a finish-install action fails and should not be attempted again.

Microsoft Win32 error

The class installer, device co-installer, or class co-installer encountered an error while processing a finish-install action, but should attempt to process the finish-install action again.

By returning a Win32 error code, the installer indicates that Windows should run another finish-install process to complete the finish-install actions the next time the device is enumerated. The installer should also inform the user of this situation.

 

If all the co-installers return NO_ERROR and the class installer returns ERROR_DI_DO_DEFAULT, a finish-install process clears the device as being flagged to perform a finish install action. However, if an installer returns a Win32 error code, the finish-install process does not attempt any additional finish-install actions, does not clear the device as being flagged to perform a finish install action, and exits. Windows will subsequently run another finish-install process in an attempt to complete the finish-install actions.

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft