Add functions to add the User UpgradeCodes.

This commit is contained in:
Aric Stewart 2005-06-07 20:02:27 +00:00 committed by Alexandre Julliard
parent 90bc168c87
commit 19ba432b2b
2 changed files with 36 additions and 0 deletions

View File

@ -384,6 +384,7 @@ extern UINT MSIREG_OpenProductsKey(LPCWSTR szProduct, HKEY* key, BOOL create);
extern UINT MSIREG_OpenUserFeaturesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
extern UINT MSIREG_OpenUserComponentsKey(LPCWSTR szComponent, HKEY* key, BOOL create);
extern UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
extern UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szProduct, HKEY* key, BOOL create);
/* msi dialog interface */
typedef VOID (*msi_dialog_event_handler)( MSIPACKAGE*, LPCWSTR, LPCWSTR, msi_dialog* );

View File

@ -141,6 +141,20 @@ static const WCHAR szInstaller_UpgradeCodes_fmt[] = {
'U','p','g','r','a','d','e','C','o','d','e','s','\\',
'%','s',0};
static const WCHAR szInstaller_UserUpgradeCodes[] = {
'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'I','n','s','t','a','l','l','e','r','\\',
'U','p','g','r','a','d','e','C','o','d','e','s',0};
static const WCHAR szInstaller_UserUpgradeCodes_fmt[] = {
'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'I','n','s','t','a','l','l','e','r','\\',
'U','p','g','r','a','d','e','C','o','d','e','s','\\',
'%','s',0};
#define SQUISH_GUID_SIZE 33
BOOL unsquash_guid(LPCWSTR in, LPWSTR out)
@ -455,6 +469,27 @@ UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create)
return rc;
}
UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create)
{
UINT rc;
WCHAR squished_pc[GUID_SIZE];
WCHAR keypath[0x200];
TRACE("%s\n",debugstr_w(szUpgradeCode));
squash_guid(szUpgradeCode,squished_pc);
TRACE("squished (%s)\n", debugstr_w(squished_pc));
sprintfW(keypath,szInstaller_UserUpgradeCodes_fmt,squished_pc);
if (create)
rc = RegCreateKeyW(HKEY_CURRENT_USER,keypath,key);
else
rc = RegOpenKeyW(HKEY_CURRENT_USER,keypath,key);
return rc;
}
/*************************************************************************
* MsiDecomposeDescriptorW [MSI.@]
*