Module: wine Branch: master Commit: 6dc49e4b685850a76a35b1d1d102903a0231c5cc URL: https://source.winehq.org/git/wine.git/?a=commit;h=6dc49e4b685850a76a35b1d1d...
Author: Piotr Caban piotr@codeweavers.com Date: Mon Jun 18 20:13:14 2018 +0200
msi: Add support for ProductToBeRegistered property.
Signed-off-by: Piotr Caban piotr@codeweavers.com Signed-off-by: Hans Leidekker hans@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/msi/action.c | 3 ++- dlls/msi/msipriv.h | 1 + dlls/msi/package.c | 11 ++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 7c71800..74917af 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -5222,7 +5222,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/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 8acace3..c88f1d9 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -1200,6 +1200,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/dlls/msi/package.c b/dlls/msi/package.c index 840e4a7..c50f9e3 100644 --- a/dlls/msi/package.c +++ b/dlls/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);
@@ -1560,6 +1561,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];