TWUDownloadUpdate
The TWUDownloadUpdate function downloads the update installer for the application whose package information file was retrieved by a prior call to TWUCheckUpdate. The update installer is stored in a temporary location; your application must call TWUInstallUpdate to perform the actual update.
URESULT TWUDownloadUpdate( 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.
Processing flags
The dwFlags parameter can be a combination of the following values:
Value | Description |
---|---|
TWU_UFLAGS_DEFAULT (0) | Perform default processing only. This includes the display of a progress dialog box during the download process and a digital signature check when the download is complete. This flag must be used on its own; all other flags override it. |
TWU_UFLAGS_NOPROGRESS (0x00000001) | Do not display a progress dialog box during the download. |
TWU_UFLAGS_NOTRUSTCHECK (0x00000002) | Do not check the digital signature of the download package after downloading. The default is to perform a digital signature check and let the user override any failure. |
TWU_UFLAGS_NOCACHE (0x00000004) | Do a direct download of the update installer, bypassing the download cache. Without this flag, the Internet Explorer cache is used for the download. This can improve the download speed, in particular if a previously failed update is retried, but it can also cause an outdated version of the update installer to be used. With this flag, each download is taken straight from the original server without the use of the Internet Explorer cache, at the expense of potentially extra download time. |