TWUGetPackageInstaller

The TWUGetPackageInstaller function downloads a package installer from the Internet server, using the package information supplied. Typically, this package information has been previously downloaded by TWUOpenUpdateURL or TWUGetPIF. After a successful download, you can run the package's installer by calling TWURunPackageInstaller.

URESULT TWUGetPackageInstaller(
    TWUHANDLE hSession,
    const TCHAR *pszLocalPath,
    TWUPackageData *pPackage
);

Delphi version:

function TWUGetPackageInstaller(
    hSession: TWUHANDLE;
    pszLocalPath: PTCHAR;
    var pPackage: TWUPackageData
): URESULT;

Parameters

hSession
[Input] Handle to an open TWU session.
pszLocalPath
[Input, optional] Pointer to the local path for the downloaded package installer, or NULL to download the package installer to the TEMP folder. If you specify this parameter, it must be a fully qualified file path.
pPackage
[Input, output] Pointer to the package data whose installer must be downloaded. The szDownloadPath data member is updated to reflect the local path of the downloaded package installer.

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.