https://git.reactos.org/?p=reactos.git;a=commitdiff;h=da8483616c2eb10864d1e297e0a6fedb7df880f0

commit da8483616c2eb10864d1e297e0a6fedb7df880f0
Author:     winesync <[email protected]>
AuthorDate: Sat Mar 12 16:34:11 2022 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Sun Mar 20 19:27:55 2022 +0100

    [WINESYNC] msi: Add support for ProductToBeRegistered property.
    
    Signed-off-by: Piotr Caban <[email protected]>
    Signed-off-by: Hans Leidekker <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 6dc49e4b685850a76a35b1d1d102903a0231c5cc by Piotr Caban 
<[email protected]>
---
 dll/win32/msi/action.c  |  3 ++-
 dll/win32/msi/msipriv.h |  1 +
 dll/win32/msi/package.c | 11 ++++++++++-
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/dll/win32/msi/action.c b/dll/win32/msi/action.c
index bca9dbfd66d..cd0f38a0469 100644
--- a/dll/win32/msi/action.c
+++ b/dll/win32/msi/action.c
@@ -5236,7 +5236,8 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
     UINT rc;
 
     /* FIXME: also need to publish if the product is in advertise mode */
-    if (!msi_check_publish(package))
+    if (!msi_get_property_int( package->db, szProductToBeRegistered, 0 )
+            && !msi_check_publish(package))
         return ERROR_SUCCESS;
 
     rc = MSIREG_OpenUninstallKey(package->ProductCode, package->platform, 
&hkey, TRUE);
diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h
index 1f1ebeae680..1ddae28aaea 100644
--- a/dll/win32/msi/msipriv.h
+++ b/dll/win32/msi/msipriv.h
@@ -1201,6 +1201,7 @@ static const WCHAR szInstallLocation[] = 
{'I','n','s','t','a','l','l','L','o','c
 static const WCHAR szProperty[] = {'P','r','o','p','e','r','t','y',0};
 static const WCHAR szUninstallable[] = 
{'U','n','i','n','s','t','a','l','l','a','b','l','e',0};
 static const WCHAR szEXECUTEACTION[] = 
{'E','X','E','C','U','T','E','A','C','T','I','O','N',0};
+static const WCHAR szProductToBeRegistered[] = 
{'P','r','o','d','u','c','t','T','o','B','e','R','e','g','i','s','t','e','r','e','d',0};
 
 /* memory allocation macro functions */
 static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c
index 858f835e2bb..04ea2a75993 100644
--- a/dll/win32/msi/package.c
+++ b/dll/win32/msi/package.c
@@ -1471,7 +1471,8 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE 
**pPackage)
     DWORD index = 0;
     MSISUMMARYINFO *si;
     BOOL delete_on_close = FALSE;
-    WCHAR *info_template, *productname;
+    WCHAR *info_template, *productname, *product_code;
+    MSIINSTALLCONTEXT context;
 
     TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
 
@@ -1567,6 +1568,14 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE 
**pPackage)
     set_installed_prop( package );
     msi_set_context( package );
 
+    product_code = get_product_code( db );
+    if (msi_locate_product( product_code, &context ) == ERROR_SUCCESS)
+    {
+        TRACE("product already registered\n");
+        msi_set_property( package->db, szProductToBeRegistered, szOne, -1 );
+    }
+    msi_free(product_code);
+
     while (1)
     {
         WCHAR patch_code[GUID_SIZE];

Reply via email to