TWUCheckUpdate

The TWUCheckUpdate function retrieves a package information file and uses the information in it to check if the currently installed version of the application needs to be updated.

URESULT TWUCheckUpdate(
    TWUPDATE hUpdate,
    const TCHAR *pszUpdateURL,
    const TCHAR *pszSection,
    DWORD dwFlags,
    BOOL *pbUpdateAvailable
);

Parameters

hUpdate
[Input] Handle of active update session, created with TWUOpenUpdate.
pszUpdateURL
[Input] Fully qualified URL to the package information file that you want to download and parse. This must include the protocol specifier. Some examples of valid URLs:

file://machine/share/updates/wizupdate.txt
ftp://ftp.tarma.com/public/wizupdate.txt
https://tarma.com/download/wizupdate.txt
https://secure.tarma.com/download/wizupdate.txt

Be sure to include the file:// prefix if you are referring to a local or UNC file path.
pszSection
[Input,optional] Name of the package section to use in the package information file. This name is optional; if you pass NULL to this parameter, the default section name "main" will be used.
dwFlags
[Input] Processing flags; must be set to TWU_UFLAGS_DEFAULT (0) in the current release.
pbUpdateAvailable
[Output] Receives a TRUE (nonzero) or FALSE (0) value. A nonzero value indicates that a newer version of the application specified by the package information file is available, or that the application in question is not yet installed on the system. A FALSE value indicates that the application in question is up to date, or that no update information was available. In the latter case, the return value of the function will be a nonzero Win32 API error code.

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.