msi: Add User UpgradeCodes
Aric Stewart
aric at codeweavers.com
Mon Jun 6 15:02:36 CDT 2005
Add functions to add the User UpgradeCodes.
-------------- next part --------------
Index: dlls/msi/registry.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/registry.c,v
retrieving revision 1.9
diff -u -r1.9 registry.c
--- dlls/msi/registry.c 6 May 2005 14:33:02 -0000 1.9
+++ dlls/msi/registry.c 6 Jun 2005 19:59:43 -0000
@@ -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)
@@ -454,6 +468,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.@]
Index: dlls/msi/msipriv.h
===================================================================
RCS file: /home/wine/wine/dlls/msi/msipriv.h,v
retrieving revision 1.64
diff -u -r1.64 msipriv.h
--- dlls/msi/msipriv.h 6 Jun 2005 15:40:15 -0000 1.64
+++ dlls/msi/msipriv.h 6 Jun 2005 19:59:43 -0000
@@ -384,6 +384,7 @@
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* );
More information about the wine-patches
mailing list