Commit a5a58910 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

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.
parent e31ee69f
...@@ -304,10 +304,9 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS ...@@ -304,10 +304,9 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
MSIHANDLE patch = 0, info = 0; MSIHANDLE patch = 0, info = 0;
UINT r = ERROR_SUCCESS, type; UINT r = ERROR_SUCCESS, type;
DWORD size = 0; DWORD size = 0;
LPCWSTR cmd_ptr = szCommandLine; LPCWSTR cmd_ptr = szCommandLine, product_code = szProductCode;
LPCWSTR product_code = szProductCode; LPWSTR beg, end, cmd = NULL, codes = NULL;
LPWSTR beg, end; BOOL succeeded = FALSE;
LPWSTR cmd = NULL, codes = NULL;
static const WCHAR patcheq[] = {'P','A','T','C','H','=',0}; static const WCHAR patcheq[] = {'P','A','T','C','H','=',0};
static WCHAR empty[] = {0}; static WCHAR empty[] = {0};
...@@ -366,14 +365,17 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS ...@@ -366,14 +365,17 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
while ((end = strchrW(beg, '}'))) while ((end = strchrW(beg, '}')))
{ {
*(end + 1) = '\0'; *(end + 1) = '\0';
r = MsiConfigureProductExW(beg, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, cmd); r = MsiConfigureProductExW(beg, INSTALLLEVEL_DEFAULT, INSTALLSTATE_DEFAULT, cmd);
if (r != ERROR_SUCCESS) if (r == ERROR_SUCCESS)
goto done; {
TRACE("patch applied\n");
succeeded = TRUE;
}
beg = end + 2; beg = end + 2;
} }
if (succeeded)
r = ERROR_SUCCESS;
done: done:
msi_free(cmd); msi_free(cmd);
msi_free(codes); msi_free(codes);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment