msi: Only extract a file when its disk id matches the media disk id.

This makes sure that an updated file is extracted from the cabinet stream
included in the patch, instead of the original source.
This commit is contained in:
Hans Leidekker 2010-05-12 14:18:41 +02:00 committed by Alexandre Julliard
parent 376c2fd02b
commit 6475c11c1f
1 changed files with 3 additions and 5 deletions

View File

@ -179,6 +179,7 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
LPWSTR *path, DWORD *attrs, PVOID user)
{
static MSIFILE *f = NULL;
MSIMEDIAINFO *mi = user;
if (action == MSICABEXTRACT_BEGINEXTRACT)
{
@ -189,11 +190,8 @@ static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
return FALSE;
}
if (f->state != msifs_missing && f->state != msifs_overwrite)
{
TRACE("Skipping extraction of %s\n", debugstr_w(file));
if (f->disk_id != mi->disk_id || (f->state != msifs_missing && f->state != msifs_overwrite))
return FALSE;
}
msi_file_update_ui(package, f, szInstallFiles);
@ -257,7 +255,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
data.mi = mi;
data.package = package;
data.cb = installfiles_cb;
data.user = NULL;
data.user = mi;
if (file->IsCompressed &&
!msi_cabextract(package, mi, &data))