Hans Leidekker : msi: Handle non-null product code in MSI_ApplyPatchW.

Alexandre Julliard julliard at winehq.org
Tue May 4 13:06:36 CDT 2010


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue May  4 09:07:23 2010 +0200

msi: Handle non-null product code in MSI_ApplyPatchW.

---

 dlls/msi/msi.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 8d63972..e4ad682 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -359,21 +359,27 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
     lstrcatW(cmd, patcheq);
     lstrcatW(cmd, szPatchPackage);
 
-    beg = codes;
-    while ((end = strchrW(beg, '}')))
+    if (szProductCode)
+        r = MsiConfigureProductExW(szProductCode, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, cmd);
+    else
     {
-        *(end + 1) = '\0';
-        r = MsiConfigureProductExW(beg, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, cmd);
-        if (r == ERROR_SUCCESS)
+        beg = codes;
+        while ((end = strchrW(beg, '}')))
         {
-            TRACE("patch applied\n");
-            succeeded = TRUE;
+            *(end + 1) = '\0';
+            r = MsiConfigureProductExW(beg, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, cmd);
+            if (r == ERROR_SUCCESS)
+            {
+                TRACE("patch applied\n");
+                succeeded = TRUE;
+            }
+            beg = end + 2;
         }
-        beg = end + 2;
+
+        if (succeeded)
+            r = ERROR_SUCCESS;
     }
 
-    if (succeeded)
-        r = ERROR_SUCCESS;
 done:
     msi_free(cmd);
     msi_free(codes);




More information about the wine-cvs mailing list