Add functions to add the User UpgradeCodes.
diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c
index 15e9109..0129861 100644
--- a/dlls/msi/registry.c
+++ b/dlls/msi/registry.c
@@ -141,6 +141,20 @@
'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 @@
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.@]
*