msi: Assume that file patches from registered MSI patches have already been applied.

This commit is contained in:
Hans Leidekker 2015-04-10 12:58:26 +02:00 committed by Alexandre Julliard
parent e4fd6265eb
commit d263c91ce2
3 changed files with 16 additions and 1 deletions

View File

@ -448,6 +448,17 @@ static MSIFILEPATCH *find_filepatch( MSIPACKAGE *package, UINT disk_id, const WC
return NULL;
}
static BOOL is_registered_patch_media( MSIPACKAGE *package, UINT disk_id )
{
MSIPATCHINFO *patch;
LIST_FOR_EACH_ENTRY( patch, &package->patches, MSIPATCHINFO, entry )
{
if (patch->disk_id == disk_id && patch->registered) return TRUE;
}
return FALSE;
}
static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
LPWSTR *path, DWORD *attrs, PVOID user)
{
@ -457,7 +468,8 @@ static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
{
MSICOMPONENT *comp;
if (!(patch = find_filepatch( package, patch->disk_id, file ))) return FALSE;
if (is_registered_patch_media( package, patch->disk_id ) ||
!(patch = find_filepatch( package, patch->disk_id, file ))) return FALSE;
comp = patch->File->Component;
comp->Action = msi_get_component_action( package, comp );

View File

@ -193,6 +193,7 @@ typedef struct tagMSIPATCHINFO
LPWSTR localfile;
MSIPATCHSTATE state;
BOOL delete_on_close;
BOOL registered;
UINT disk_id;
} MSIPATCHINFO;

View File

@ -918,6 +918,7 @@ static UINT msi_apply_patch_package( MSIPACKAGE *package, const WCHAR *file )
goto done;
r = ERROR_OUTOFMEMORY;
patch->registered = FALSE;
if (!(patch->filename = strdupW( file ))) goto done;
if (!(patch->localfile = strdupW( localfile ))) goto done;
@ -1034,6 +1035,7 @@ UINT msi_apply_registered_patch( MSIPACKAGE *package, LPCWSTR patch_code )
msiobj_release( &patch_db->hdr );
return r;
}
patch_info->registered = TRUE;
patch_info->localfile = strdupW( patch_file );
if (!patch_info->localfile)
{