msi: Add a partial implementation of MsiDetermineApplicablePatchesW.
This commit is contained in:
parent
1169aa9a58
commit
05e9a1fce8
@ -501,7 +501,7 @@ static UINT msi_apply_substorage_transform( MSIPACKAGE *package,
|
|||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si )
|
UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si )
|
||||||
{
|
{
|
||||||
static const WCHAR szProdCode[] = { 'P','r','o','d','u','c','t','C','o','d','e',0 };
|
static const WCHAR szProdCode[] = { 'P','r','o','d','u','c','t','C','o','d','e',0 };
|
||||||
LPWSTR guid_list, *guids, product_code;
|
LPWSTR guid_list, *guids, product_code;
|
||||||
|
@ -489,13 +489,86 @@ UINT WINAPI MsiDetermineApplicablePatchesA(LPCSTR szProductPackagePath,
|
|||||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
return ERROR_CALL_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static UINT MSI_ApplicablePatchW( MSIPACKAGE *package, LPCWSTR patch )
|
||||||
|
{
|
||||||
|
MSISUMMARYINFO *si;
|
||||||
|
MSIDATABASE *patch_db;
|
||||||
|
UINT r = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
r = MSI_OpenDatabaseW( patch, MSIDBOPEN_READONLY, &patch_db );
|
||||||
|
if (r != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
WARN("failed to open patch file %s\n", debugstr_w(patch));
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
si = MSI_GetSummaryInformationW( patch_db->storage, 0 );
|
||||||
|
if (!si)
|
||||||
|
{
|
||||||
|
r = ERROR_FUNCTION_FAILED;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
r = msi_check_patch_applicable( package, si );
|
||||||
|
if (r != ERROR_SUCCESS)
|
||||||
|
TRACE("patch not applicable\n");
|
||||||
|
|
||||||
|
done:
|
||||||
|
msiobj_release( &patch_db->hdr );
|
||||||
|
msiobj_release( &si->hdr );
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
UINT WINAPI MsiDetermineApplicablePatchesW(LPCWSTR szProductPackagePath,
|
UINT WINAPI MsiDetermineApplicablePatchesW(LPCWSTR szProductPackagePath,
|
||||||
DWORD cPatchInfo, PMSIPATCHSEQUENCEINFOW pPatchInfo)
|
DWORD cPatchInfo, PMSIPATCHSEQUENCEINFOW pPatchInfo)
|
||||||
{
|
{
|
||||||
FIXME("(%s, %d, %p): stub!\n", debugstr_w(szProductPackagePath),
|
UINT i, r, ret = ERROR_FUNCTION_FAILED;
|
||||||
cPatchInfo, pPatchInfo);
|
MSIPACKAGE *package;
|
||||||
|
|
||||||
return ERROR_CALL_NOT_IMPLEMENTED;
|
TRACE("(%s, %d, %p)\n", debugstr_w(szProductPackagePath), cPatchInfo, pPatchInfo);
|
||||||
|
|
||||||
|
r = MSI_OpenPackageW( szProductPackagePath, &package );
|
||||||
|
if (r != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
ERR("failed to open package %u\n", r);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < cPatchInfo; i++)
|
||||||
|
{
|
||||||
|
switch (pPatchInfo[i].ePatchDataType)
|
||||||
|
{
|
||||||
|
case MSIPATCH_DATATYPE_PATCHFILE:
|
||||||
|
{
|
||||||
|
FIXME("patch ordering not supported\n");
|
||||||
|
r = MSI_ApplicablePatchW( package, pPatchInfo[i].szPatchData );
|
||||||
|
if (r != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
pPatchInfo[i].dwOrder = ~0u;
|
||||||
|
pPatchInfo[i].uStatus = ERROR_PATCH_TARGET_NOT_FOUND;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pPatchInfo[i].dwOrder = i;
|
||||||
|
pPatchInfo[i].uStatus = ret = ERROR_SUCCESS;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
FIXME("patch data type %u not supported\n", pPatchInfo[i].ePatchDataType);
|
||||||
|
pPatchInfo[i].dwOrder = ~0u;
|
||||||
|
pPatchInfo[i].uStatus = ERROR_PATCH_TARGET_NOT_FOUND;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE(" szPatchData: %s\n", debugstr_w(pPatchInfo[i].szPatchData));
|
||||||
|
TRACE("ePatchDataType: %u\n", pPatchInfo[i].ePatchDataType);
|
||||||
|
TRACE(" dwOrder: %u\n", pPatchInfo[i].dwOrder);
|
||||||
|
TRACE(" uStatus: %u\n", pPatchInfo[i].uStatus);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT WINAPI MsiDeterminePatchSequenceA(LPCSTR szProductCode, LPCSTR szUserSid,
|
UINT WINAPI MsiDeterminePatchSequenceA(LPCSTR szProductCode, LPCSTR szUserSid,
|
||||||
|
@ -683,6 +683,8 @@ extern UINT MSI_DatabaseApplyTransformW( MSIDATABASE *db,
|
|||||||
LPCWSTR szTransformFile, int iErrorCond );
|
LPCWSTR szTransformFile, int iErrorCond );
|
||||||
extern void append_storage_to_db( MSIDATABASE *db, IStorage *stg );
|
extern void append_storage_to_db( MSIDATABASE *db, IStorage *stg );
|
||||||
|
|
||||||
|
extern UINT msi_check_patch_applicable( MSIPACKAGE *package, MSISUMMARYINFO *si );
|
||||||
|
|
||||||
/* action internals */
|
/* action internals */
|
||||||
extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR );
|
extern UINT MSI_InstallPackage( MSIPACKAGE *, LPCWSTR, LPCWSTR );
|
||||||
extern void ACTION_free_package_structures( MSIPACKAGE* );
|
extern void ACTION_free_package_structures( MSIPACKAGE* );
|
||||||
|
@ -237,6 +237,8 @@ typedef struct tagMSIPATCHSEQUENCEINFOW
|
|||||||
|
|
||||||
#define MAX_FEATURE_CHARS 38
|
#define MAX_FEATURE_CHARS 38
|
||||||
|
|
||||||
|
#define ERROR_PATCH_TARGET_NOT_FOUND 1642
|
||||||
|
|
||||||
/* Strings defined in msi.h */
|
/* Strings defined in msi.h */
|
||||||
/* Advertised Information */
|
/* Advertised Information */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user