Hans Leidekker : msi: Try to apply a patch to each product it is targeted for.

Alexandre Julliard julliard at winehq.org
Wed Apr 21 10:40:23 CDT 2010


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Apr 21 11:39:34 2010 +0200

msi: Try to apply a patch to each product it is targeted for.

A patch may target multiple products but only one of them needs to
be installed for the patch to succeed. Fixes an Acrobat Reader 9 patch.

---

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

diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index 0d56641..983c0f5 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -304,10 +304,9 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
     MSIHANDLE patch = 0, info = 0;
     UINT r = ERROR_SUCCESS, type;
     DWORD size = 0;
-    LPCWSTR cmd_ptr = szCommandLine;
-    LPCWSTR product_code = szProductCode;
-    LPWSTR beg, end;
-    LPWSTR cmd = NULL, codes = NULL;
+    LPCWSTR cmd_ptr = szCommandLine, product_code = szProductCode;
+    LPWSTR beg, end, cmd = NULL, codes = NULL;
+    BOOL succeeded = FALSE;
 
     static const WCHAR patcheq[] = {'P','A','T','C','H','=',0};
     static WCHAR empty[] = {0};
@@ -366,14 +365,17 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
     while ((end = strchrW(beg, '}')))
     {
         *(end + 1) = '\0';
-
         r = MsiConfigureProductExW(beg, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, cmd);
-        if (r != ERROR_SUCCESS)
-            goto done;
-
+        if (r == ERROR_SUCCESS)
+        {
+            TRACE("patch applied\n");
+            succeeded = TRUE;
+        }
         beg = end + 2;
     }
 
+    if (succeeded)
+        r = ERROR_SUCCESS;
 done:
     msi_free(cmd);
     msi_free(codes);




More information about the wine-cvs mailing list