TWUInstallUpdate

The TWUInstallUpdate function runs the update installer for the application whose package information file was retrieved by a prior call to TWUCheckUpdate. The update installer must have been downloaded by a prior call to TWUDownloadUpdate.

URESULT TWUInstallUpdate(
    TWUPDATE hUpdate,
    DWORD dwFlags
);

Parameters

hUpdate
[Input] Handle of active update session, created with TWUOpenUpdate.
dwFlags
[Input] Processing flags; see the section Processing flags below for details.

Return value

If the function succeeds, it returns ERROR_SUCCESS (0). If the function fails, it returns a nonzero Win32 API error code. You can use TWUGetErrorMessage to retrieve the error message that corresponds to the error code.

Remarks

The update installer will be executed using the parameters specified in its package information file. Typically, this means that it will run in unattended (quiet, batch, non-interactive) mode with only a progress dialog box visible.

Processing flags

The dwFlags parameter can be a combination of the following values:

Value Description
TWU_UFLAGS_DEFAULT (0) Perform default processing only. This flag must be used on its own; any other flags override it.
TWU_UFLAGS_RUNAS (0x00000001)

Use the shell's Run As facility to run the installer. This typically results in a UAC prompt (Windows Vista, 7, 2008) or a Run As dialog box (Windows 2000, XP, 2003) prior to starting the installer and allows the installer to run with elevated privileges even if the calling program does not.

This option has no effect on Windows 95, 98, Me, and NT4.