TWUGetVersionInfo

The TWUGetVersionInfo function retrieves the fixed VERSIONINFO for a local file. This version information can be used for version comparisons prior to updates.

Tip: TWUCheckUpdateVersion combines the functionality of TWUGetVersionInfo with a version comparison. You might find it more convenient to use that function.

URESULT TWUGetVersionInfo(
    const TCHAR *pszFilePath,
    VS_FIXEDFILEINFO *pFFI
);

Delphi version:

function TWUGetVersionInfo(
    pszFilePath: PTCHAR;
    var pFFI: VS_FIXEDFILEINFO
): URESULT;

Parameters

pszFilePath
[Input] Fully qualified local file path from which to retrieve the version information.
pFFI
[Output] Pointer to a buffer that receives the version information from the file, if any. If the file cannot be found or does not have a VERSIONINFO resource, all data members of this buffer are set to 0.

Return value

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