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

Alexandre Julliard julliard at wine.codeweavers.com
Fri Apr 10 08:56:27 CDT 2015


Module: wine
Branch: master
Commit: d263c91ce28b39102770c03d65ecab0d71a97e3c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d263c91ce28b39102770c03d65ecab0d71a97e3c

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Fri Apr 10 12:58:26 2015 +0200

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

---

 dlls/msi/files.c   | 14 +++++++++++++-
 dlls/msi/msipriv.h |  1 +
 dlls/msi/patch.c   |  2 ++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index 3116754..ca758dd 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -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 );
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 5a8c24f..9bec75f 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -193,6 +193,7 @@ typedef struct tagMSIPATCHINFO
     LPWSTR localfile;
     MSIPATCHSTATE state;
     BOOL delete_on_close;
+    BOOL registered;
     UINT disk_id;
 } MSIPATCHINFO;
 
diff --git a/dlls/msi/patch.c b/dlls/msi/patch.c
index b7bf2ef..5456359 100644
--- a/dlls/msi/patch.c
+++ b/dlls/msi/patch.c
@@ -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)
     {




More information about the wine-cvs mailing list