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>
This commit is contained in:
Piotr Caban 2018-06-18 20:13:14 +02:00 committed by Alexandre Julliard
parent 40ce1dd473
commit 6dc49e4b68
3 changed files with 13 additions and 2 deletions

View File

@ -5222,7 +5222,8 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
UINT rc; UINT rc;
/* FIXME: also need to publish if the product is in advertise mode */ /* 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; return ERROR_SUCCESS;
rc = MSIREG_OpenUninstallKey(package->ProductCode, package->platform, &hkey, TRUE); rc = MSIREG_OpenUninstallKey(package->ProductCode, package->platform, &hkey, TRUE);

View File

@ -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 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 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 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 */ /* memory allocation macro functions */
static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1); static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);

View File

@ -1471,7 +1471,8 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
DWORD index = 0; DWORD index = 0;
MSISUMMARYINFO *si; MSISUMMARYINFO *si;
BOOL delete_on_close = FALSE; 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); TRACE("%s %p\n", debugstr_w(szPackage), pPackage);
@ -1560,6 +1561,14 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
set_installed_prop( package ); set_installed_prop( package );
msi_set_context( 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) while (1)
{ {
WCHAR patch_code[GUID_SIZE]; WCHAR patch_code[GUID_SIZE];