TWUInstalledInfo

The TWUInstalledInfo structure defines the information about an installed product that is returned by TWUFindInstalledInfo. This information is obtained from the product's uninstall registration in the Windows registry. Depending on the installer, some of the information may be incomplete (although both InstallMate and Windows Installer register all required information, some other installers may not).

typedef struct _TWUInstalledInfo
{
    UINT uStructSize;
    DWORD dwValidFlags;
    DWORD dwVersionLow;
    DWORD dwVersionHigh;
    TCHAR szDisplayName[256];
    TCHAR szDisplayVersion[64];
    TCHAR szInstallPath[MAX_PATH];
} TWUInstalledInfo;

Delphi version:

type TWUInstalledInfo = record
begin
    uStructSize: UINT;
    dwValidFlags: DWORD;
    dwVersionLow: DWORD;
    dwVersionHigh: DWORD;
    szDisplayName: array[0.255] of TCHAR;
    szDisplayVersion: array [0..63] of TCHAR;
    szInstallPath: array[0..259] of TCHAR;
end;

Data members

uStructSize
[Input] You must set this to sizeof(TWUInstalledInfo) before calling TWUFindInstalledInfo.
dwValidFlags
[Output] Indicates which fields are valid; see Valid flags below.
dwVersionLow
[Output] Least-significant DWORD of the installed product version. This is obtained from the DisplayVersion registry value if it contains a valid version number; else it is set to 0.
dwVersionHigh
[Output] Most-significant DWORD of the installed product version. This is obtained from the DisplayVersion registry value if it contains a valid version number; else it is set from VersionMajor and VersionMinor if present. If none of those values is present, it is set to 0.
szDisplayName
[Output] User-visible name of the product as defined by the DisplayName registry value.
szDisplayversion
[Output] User-visible version of the product as defined by the DisplayVersion registry value.
szInstalledPath
[Output] Main installation folder for the product as defined by the InstallLocation registry value.

Valid flags

The TWUInstalledInfo structure uses the following flags to indicate which fields are valid upon return:

Flag Description
TWUII_VALID_DISPLAYNAME szDisplayName is valid
TWUII_VALID_DISPLAYVERSION szDisplayVersion is valid
TWUII_VALID_INSTALLPATH szInstalledPath is valid
TWUII_VALID_VERSION dwVersionLow and dwVersionLow are valid