Commit 52aab76e authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Put the uninstall key for 32-bit packages under Wow6432Node on 64-bit.

parent e66b73e5
...@@ -4759,7 +4759,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package) ...@@ -4759,7 +4759,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
if (!msi_check_publish(package)) if (!msi_check_publish(package))
return ERROR_SUCCESS; return ERROR_SUCCESS;
rc = MSIREG_OpenUninstallKey(package->ProductCode, &hkey, TRUE); rc = MSIREG_OpenUninstallKey(package, &hkey, TRUE);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS)
return rc; return rc;
...@@ -4839,7 +4839,7 @@ static UINT msi_unpublish_product(MSIPACKAGE *package, WCHAR *remove) ...@@ -4839,7 +4839,7 @@ static UINT msi_unpublish_product(MSIPACKAGE *package, WCHAR *remove)
MSIREG_DeleteProductKey(package->ProductCode); MSIREG_DeleteProductKey(package->ProductCode);
MSIREG_DeleteUserDataProductKey(package->ProductCode); MSIREG_DeleteUserDataProductKey(package->ProductCode);
MSIREG_DeleteUninstallKey(package->ProductCode); MSIREG_DeleteUninstallKey(package);
if (package->Context == MSIINSTALLCONTEXT_MACHINE) if (package->Context == MSIINSTALLCONTEXT_MACHINE)
{ {
......
...@@ -788,8 +788,8 @@ extern BOOL unsquash_guid(LPCWSTR in, LPWSTR out); ...@@ -788,8 +788,8 @@ extern BOOL unsquash_guid(LPCWSTR in, LPWSTR out);
extern BOOL squash_guid(LPCWSTR in, LPWSTR out); extern BOOL squash_guid(LPCWSTR in, LPWSTR out);
extern BOOL encode_base85_guid(GUID *,LPWSTR); extern BOOL encode_base85_guid(GUID *,LPWSTR);
extern BOOL decode_base85_guid(LPCWSTR,GUID*); extern BOOL decode_base85_guid(LPCWSTR,GUID*);
extern UINT MSIREG_OpenUninstallKey(LPCWSTR szProduct, HKEY* key, BOOL create); extern UINT MSIREG_OpenUninstallKey(MSIPACKAGE *package, HKEY *key, BOOL create);
extern UINT MSIREG_DeleteUninstallKey(LPCWSTR szProduct); extern UINT MSIREG_DeleteUninstallKey(MSIPACKAGE *package);
extern UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, extern UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid,
MSIINSTALLCONTEXT context, HKEY* key, BOOL create); MSIINSTALLCONTEXT context, HKEY* key, BOOL create);
extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context, extern UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, MSIINSTALLCONTEXT context,
......
...@@ -418,7 +418,7 @@ static UINT set_installed_prop( MSIPACKAGE *package ) ...@@ -418,7 +418,7 @@ static UINT set_installed_prop( MSIPACKAGE *package )
HKEY hkey = 0; HKEY hkey = 0;
UINT r; UINT r;
r = MSIREG_OpenUninstallKey( package->ProductCode, &hkey, FALSE ); r = MSIREG_OpenUninstallKey( package, &hkey, FALSE );
if (r == ERROR_SUCCESS) if (r == ERROR_SUCCESS)
{ {
RegCloseKey( hkey ); RegCloseKey( hkey );
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(msi); WINE_DEFAULT_DEBUG_CHANNEL(msi);
static const BOOL is_64bit = sizeof(void *) > sizeof(int);
/* /*
* This module will be all the helper functions for registry access by the * This module will be all the helper functions for registry access by the
...@@ -103,6 +104,15 @@ static const WCHAR szUninstall_fmt[] = { ...@@ -103,6 +104,15 @@ static const WCHAR szUninstall_fmt[] = {
'U','n','i','n','s','t','a','l','l','\\', 'U','n','i','n','s','t','a','l','l','\\',
'%','s',0 }; '%','s',0 };
static const WCHAR szUninstall_32node_fmt[] = {
'S','o','f','t','w','a','r','e','\\',
'W','o','w','6','4','3','2','N','o','d','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'U','n','i','n','s','t','a','l','l','\\',
'%','s',0 };
static const WCHAR szUserProduct[] = { static const WCHAR szUserProduct[] = {
'S','o','f','t','w','a','r','e','\\', 'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\', 'M','i','c','r','o','s','o','f','t','\\',
...@@ -509,28 +519,36 @@ static UINT get_user_sid(LPWSTR *usersid) ...@@ -509,28 +519,36 @@ static UINT get_user_sid(LPWSTR *usersid)
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
UINT MSIREG_OpenUninstallKey(LPCWSTR szProduct, HKEY* key, BOOL create) UINT MSIREG_OpenUninstallKey(MSIPACKAGE *package, HKEY *key, BOOL create)
{ {
UINT rc; UINT rc;
WCHAR keypath[0x200]; WCHAR keypath[0x200];
TRACE("%s\n",debugstr_w(szProduct));
sprintfW(keypath,szUninstall_fmt,szProduct); TRACE("%s\n", debugstr_w(package->ProductCode));
if (is_64bit && package->platform == PLATFORM_INTEL)
sprintfW(keypath, szUninstall_32node_fmt, package->ProductCode);
else
sprintfW(keypath, szUninstall_fmt, package->ProductCode);
if (create) if (create)
rc = RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, KEY_ALL_ACCESS, NULL, key, NULL);
else else
rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, KEY_ALL_ACCESS, key);
return rc; return rc;
} }
UINT MSIREG_DeleteUninstallKey(LPCWSTR szProduct) UINT MSIREG_DeleteUninstallKey(MSIPACKAGE *package)
{ {
WCHAR keypath[0x200]; WCHAR keypath[0x200];
TRACE("%s\n",debugstr_w(szProduct));
sprintfW(keypath,szUninstall_fmt,szProduct); TRACE("%s\n", debugstr_w(package->ProductCode));
if (is_64bit && package->platform == PLATFORM_INTEL)
sprintfW(keypath, szUninstall_32node_fmt, package->ProductCode);
else
sprintfW(keypath, szUninstall_fmt, package->ProductCode);
return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment