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;
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.