DIF_FINISHINSTALL_ACTION

A DIF_FINISHINSTALL_ACTION request allows an installer to run finish-install actions in an interactive administrator context after all other device installation operations have completed.

When Sent

In Windows 7, the default finish-install action is provided by the system-supplied SetupDiFinishInstallAction function. This function processes, in the interactive context of an administrator, the RunOnce registry entries that are set for a device. If a device does not have a class installer, or a class installer returns ERROR_DI_DO_DEFAULT in response to a DIF_FINISHINSTALL_ACTION request, Windows calls SetupDiFinishInstallAction after all the installers for a device complete their finish-install actions.

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, 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. 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. Thereafter, when Windows runs the finish-install action, the action has that single opportunity to run. If the action fails then it must take appropriate steps 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 also not be installed automatically.

Who Handles

Class co-installer

Can handle

Device co-installer

Can handle

Class installer

Can handle

 

Installer Input

DeviceInfoSet

A handle to the device information set that contains the device being installed.

DeviceInfoData

A pointer to an SP_DEVINFO_DATA structure that represents the device being installed.

Device Installation Parameters

There are device installation parameters (a SP_DEVINSTALL_PARAMS structure) associated with DeviceInfoData.

Class Installation Parameters

None

Installer Output

Device Installation Parameters

An installer sets the DI_NEEDREBOOT flag if a system restart is required to complete its finish-install actions.

Installer Return Value

An installer returns one of the values that are listed in the following table.

Return valueMeaning

ERROR_DI_DO_DEFAULT

Class installer: The installer has no finish-install actions, has successfully completed the finish-install actions, or has determined that it cannot ever successfully complete its finish install actions. Device installation should perform the default processing for the request.

Co-installer: Co-installers must not return this error code.

NO_ERROR

Class installer: A class installer should not return this error code. If a class installer returns this error code, device installation does not perform the default processing for the request.

Co-installer: The installer has no finish-install actions, has successfully completed the finish-install actions, or has determined that it cannot ever successfully complete its finish install actions.

Win32 error code

Class installer or co-installer: The installer encountered an error while processing a finish-install action, and device installation should attempt to complete the finish-install actions the next time the device is enumerated in the context of an administrator.

 

Default DIF Code Handler

Windows 7 uses SetupDiFinishInstallAction.

There is no default DIF Code Handler in Windows 8 and later versions, and SetupDiFinishInstallAction has been removed.

Comments

Because device installation cannot determine from an ERROR_DI_DO_DEFAULT return code or a NO_ERROR return code whether a finish-install action actually succeeded, the installer should notify the user of the status of a finish-installer action.

For more information about finish-install actions, see How Device Installation Processes Finish-Install Actions and Implementing Finish-Install Actions.

For general information about DIF codes, see Handling DIF Codes and Calling Default DIF Code Handlers.

Requirements

Version

Supported in Windows Vista through Windows 7.

Header

Setupapi.h (include Setupapi.h)

See also

SetupDiFinishInstallAction

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft