Bewerken

Delen via


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 8 and later versions, finish-install actions do not automatically run as part of device installation. To complete a device finish-install action, a user must click on “Finish installing device software” in the Action Center to complete the installation.

For more information, see Running Finish-Install Actions.

In Windows 7, the finish-install process runs only in the context of a user with administrator credentials at one of the following times:

  • The next time that a user who has administrator credentials logs on while the device is attached.
  • When the device is reattached.
  • When the user selects Scan for hardware changes in Device Manager.

If a user is signed in without administrative privileges, Windows prompts the user for consent and credentials to run the finish-install actions in an administrator context.

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 value Meaning

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