IUpdateInstaller::BeginInstall method (wuapi.h)

Starts an asynchronous installation of the updates.


HRESULT BeginInstall(
  [in]  IUnknown         *onProgressChanged,
  [in]  IUnknown         *onCompleted,
  [in]  VARIANT          state,
  [out] IInstallationJob **retval


[in] onProgressChanged

An IInstallationProgressChangedCallback interface that is called periodically for installation progress changes before the installation is complete.

[in] onCompleted

An IInstallationCompletedCallback interface that is called when an installation operation is complete.

[in] state

The caller-specific state that is returned by the AsyncState property of the IInstallationJob interface.

[out] retval

An IInstallationJob interface that contains the properties and methods that are available to an asynchronous installation operation that was initiated.

Return value

This method returns the following HRESULT values and other COM or Windows

error codes.

Return code Description
The asynchronous installation of an update started successfully.
You cannot call this method when the installer is installing or removing an update.

Only call this method when the IsBusy property of the IUpdateInstaller interface returns VARIANT_FALSE.

Windows Update Agent (WUA) does not have updates in the collection.


If you call this method from a scripting language, set the onProgressChanged parameter to the identifier of an Automation object with a dispatch identifier (DSIPID) of zero (0) that implements the callback routine. Do the same thing for the onCompleted parameter.

This method returns WU_E_NO_UPDATE if the Updates property of IUpdateInstaller is not set. This method also returns WU_E_NO_UPDATE if the Updates property is set to an empty collection.

When you use any asynchronous WUA API in your app, you might need to implement a time-out mechanism. For more info about how to perform asynchronous WUA operations, see Guidelines for Asynchronous WUA Operations.


Requirement Value
Minimum supported client Windows XP, Windows 2000 Professional with SP3 [desktop apps only]
Minimum supported server Windows Server 2003, Windows 2000 Server with SP3 [desktop apps only]
Target Platform Windows
Header wuapi.h
Library Wuguid.lib
DLL Wuapi.dll

See also