mirror of
https://github.com/reactos/reactos.git
synced 2025-01-05 22:12:46 +00:00
[WINESYNC] msi: Use msi_get_package_code in msi_publish_product_properties.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id ddf762a82f2c578cd3b0d4ff0c13c8a08641a666 by Hans Leidekker <hans@codeweavers.com>
This commit is contained in:
parent
331be61263
commit
980ce9db3f
1 changed files with 5 additions and 23 deletions
|
@ -4288,10 +4288,8 @@ static UINT msi_publish_product_properties(MSIPACKAGE *package, HKEY hkey)
|
||||||
static const WCHAR szClients[] =
|
static const WCHAR szClients[] =
|
||||||
{'C','l','i','e','n','t','s',0};
|
{'C','l','i','e','n','t','s',0};
|
||||||
static const WCHAR szColon[] = {':',0};
|
static const WCHAR szColon[] = {':',0};
|
||||||
MSIHANDLE hdb, suminfo;
|
WCHAR *buffer, *ptr, *guids, packcode[SQUASHED_GUID_SIZE];
|
||||||
WCHAR *buffer, *ptr, guids[MAX_PATH], packcode[SQUASHED_GUID_SIZE];
|
DWORD langid;
|
||||||
DWORD langid, size;
|
|
||||||
UINT r;
|
|
||||||
|
|
||||||
buffer = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
|
buffer = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
|
||||||
msi_reg_set_val_str(hkey, INSTALLPROPERTY_PRODUCTNAMEW, buffer);
|
msi_reg_set_val_str(hkey, INSTALLPROPERTY_PRODUCTNAMEW, buffer);
|
||||||
|
@ -4325,28 +4323,12 @@ static UINT msi_publish_product_properties(MSIPACKAGE *package, HKEY hkey)
|
||||||
msi_reg_set_val_dword(hkey, INSTALLPROPERTY_INSTANCETYPEW, 0);
|
msi_reg_set_val_dword(hkey, INSTALLPROPERTY_INSTANCETYPEW, 0);
|
||||||
msi_reg_set_val_str(hkey, szClients, szColon);
|
msi_reg_set_val_str(hkey, szClients, szColon);
|
||||||
|
|
||||||
hdb = alloc_msihandle(&package->db->hdr);
|
if (!(guids = msi_get_package_code(package->db))) return ERROR_OUTOFMEMORY;
|
||||||
if (!hdb)
|
if ((ptr = strchrW(guids, ';'))) *ptr = 0;
|
||||||
return ERROR_NOT_ENOUGH_MEMORY;
|
|
||||||
|
|
||||||
r = MsiGetSummaryInformationW(hdb, NULL, 0, &suminfo);
|
|
||||||
MsiCloseHandle(hdb);
|
|
||||||
if (r != ERROR_SUCCESS)
|
|
||||||
goto done;
|
|
||||||
|
|
||||||
size = MAX_PATH;
|
|
||||||
r = MsiSummaryInfoGetPropertyW(suminfo, PID_REVNUMBER, NULL, NULL,
|
|
||||||
NULL, guids, &size);
|
|
||||||
if (r != ERROR_SUCCESS)
|
|
||||||
goto done;
|
|
||||||
|
|
||||||
ptr = strchrW(guids, ';');
|
|
||||||
if (ptr) *ptr = 0;
|
|
||||||
squash_guid(guids, packcode);
|
squash_guid(guids, packcode);
|
||||||
|
msi_free( guids);
|
||||||
msi_reg_set_val_str(hkey, INSTALLPROPERTY_PACKAGECODEW, packcode);
|
msi_reg_set_val_str(hkey, INSTALLPROPERTY_PACKAGECODEW, packcode);
|
||||||
|
|
||||||
done:
|
|
||||||
MsiCloseHandle(suminfo);
|
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue