The TWUGetPackageCount function returns the number of packages in the current package information file.
UINT TWUGetPackageCount(
TWUHANDLE hSession
);
Delphi version:
function TWUGetPackageCount(
hSession: TWUHANDLE
): UINT;
The function returns the number of packages in the current session (which may be 0), or 0 if an error occurs.