msi: Publish patches regardless of any features being installed locally.

This commit is contained in:
Hans Leidekker 2010-07-21 09:46:30 +02:00 committed by Alexandre Julliard
parent cd8e1f8e75
commit c9fb24927d
2 changed files with 20 additions and 17 deletions

View File

@ -3770,9 +3770,6 @@ static UINT msi_publish_upgrade_code(MSIPACKAGE *package)
LPWSTR upgrade;
WCHAR squashed_pc[SQUISH_GUID_SIZE];
static const WCHAR szUpgradeCode[] =
{'U','p','g','r','a','d','e','C','o','d','e',0};
upgrade = msi_dup_property(package->db, szUpgradeCode);
if (!upgrade)
return ERROR_SUCCESS;
@ -3826,21 +3823,28 @@ static BOOL msi_check_unpublish(MSIPACKAGE *package)
return TRUE;
}
static UINT msi_publish_patches( MSIPACKAGE *package, HKEY prodkey )
static UINT msi_publish_patches( MSIPACKAGE *package )
{
static const WCHAR szAllPatches[] = {'A','l','l','P','a','t','c','h','e','s',0};
WCHAR patch_squashed[GUID_SIZE];
HKEY patches_key = NULL, product_patches_key;
HKEY patches_key = NULL, product_patches_key = NULL, product_key;
LONG res;
MSIPATCHINFO *patch;
UINT r;
WCHAR *p, *all_patches = NULL;
DWORD len = 0;
res = RegCreateKeyExW( prodkey, szPatches, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &patches_key, NULL );
if (res != ERROR_SUCCESS)
r = MSIREG_OpenProductKey( package->ProductCode, NULL, package->Context, &product_key, FALSE );
if (r != ERROR_SUCCESS)
return ERROR_FUNCTION_FAILED;
res = RegCreateKeyExW( product_key, szPatches, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &patches_key, NULL );
if (res != ERROR_SUCCESS)
{
r = ERROR_FUNCTION_FAILED;
goto done;
}
r = MSIREG_OpenUserDataProductPatchesKey( package->ProductCode, package->Context, &product_patches_key, TRUE );
if (r != ERROR_SUCCESS)
goto done;
@ -3903,6 +3907,7 @@ static UINT msi_publish_patches( MSIPACKAGE *package, HKEY prodkey )
done:
RegCloseKey( product_patches_key );
RegCloseKey( patches_key );
RegCloseKey( product_key );
msi_free( all_patches );
return r;
}
@ -3919,6 +3924,13 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
HKEY hukey = NULL, hudkey = NULL;
MSIRECORD *uirow;
if (!list_empty(&package->patches))
{
rc = msi_publish_patches(package);
if (rc != ERROR_SUCCESS)
goto end;
}
/* FIXME: also need to publish if the product is in advertise mode */
if (!msi_check_publish(package))
return ERROR_SUCCESS;
@ -3937,13 +3949,6 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
if (rc != ERROR_SUCCESS)
goto end;
if (!list_empty(&package->patches))
{
rc = msi_publish_patches(package, hukey);
if (rc != ERROR_SUCCESS)
goto end;
}
rc = msi_publish_product_properties(package, hukey);
if (rc != ERROR_SUCCESS)
goto end;
@ -4699,9 +4704,6 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
HKEY upgrade;
UINT rc;
static const WCHAR szUpgradeCode[] = {
'U','p','g','r','a','d','e','C','o','d','e',0};
/* FIXME: also need to publish if the product is in advertise mode */
if (!msi_check_publish(package))
return ERROR_SUCCESS;

View File

@ -1119,6 +1119,7 @@ static const WCHAR szInprocHandler32[] = {'I','n','p','r','o','c','H','a','n','d
static const WCHAR szMIMEDatabase[] = {'M','I','M','E','\\','D','a','t','a','b','a','s','e','\\','C','o','n','t','e','n','t',' ','T','y','p','e','\\',0};
static const WCHAR szLocalPackage[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0};
static const WCHAR szOriginalDatabase[] = {'O','r','i','g','i','n','a','l','D','a','t','a','b','a','s','e',0};
static const WCHAR szUpgradeCode[] = {'U','p','g','r','a','d','e','C','o','d','e',0};
/* memory allocation macro functions */
static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);