msi: Assume that file patches from registered MSI patches have already been applied.
This commit is contained in:
parent
e4fd6265eb
commit
d263c91ce2
|
@ -448,6 +448,17 @@ static MSIFILEPATCH *find_filepatch( MSIPACKAGE *package, UINT disk_id, const WC
|
||||||
return NULL;
|
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,
|
static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
|
||||||
LPWSTR *path, DWORD *attrs, PVOID user)
|
LPWSTR *path, DWORD *attrs, PVOID user)
|
||||||
{
|
{
|
||||||
|
@ -457,7 +468,8 @@ static BOOL patchfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
|
||||||
{
|
{
|
||||||
MSICOMPONENT *comp;
|
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 = patch->File->Component;
|
||||||
comp->Action = msi_get_component_action( package, comp );
|
comp->Action = msi_get_component_action( package, comp );
|
||||||
|
|
|
@ -193,6 +193,7 @@ typedef struct tagMSIPATCHINFO
|
||||||
LPWSTR localfile;
|
LPWSTR localfile;
|
||||||
MSIPATCHSTATE state;
|
MSIPATCHSTATE state;
|
||||||
BOOL delete_on_close;
|
BOOL delete_on_close;
|
||||||
|
BOOL registered;
|
||||||
UINT disk_id;
|
UINT disk_id;
|
||||||
} MSIPATCHINFO;
|
} MSIPATCHINFO;
|
||||||
|
|
||||||
|
|
|
@ -918,6 +918,7 @@ static UINT msi_apply_patch_package( MSIPACKAGE *package, const WCHAR *file )
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
r = ERROR_OUTOFMEMORY;
|
r = ERROR_OUTOFMEMORY;
|
||||||
|
patch->registered = FALSE;
|
||||||
if (!(patch->filename = strdupW( file ))) goto done;
|
if (!(patch->filename = strdupW( file ))) goto done;
|
||||||
if (!(patch->localfile = strdupW( localfile ))) 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 );
|
msiobj_release( &patch_db->hdr );
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
patch_info->registered = TRUE;
|
||||||
patch_info->localfile = strdupW( patch_file );
|
patch_info->localfile = strdupW( patch_file );
|
||||||
if (!patch_info->localfile)
|
if (!patch_info->localfile)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue