Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/msi/classes.c | 25 ++++++++++++------------- dlls/msi/msipriv.h | 1 - 2 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/dlls/msi/classes.c b/dlls/msi/classes.c index 293aa1063b..7b0a4a4d0e 100644 --- a/dlls/msi/classes.c +++ b/dlls/msi/classes.c @@ -747,7 +747,7 @@ static UINT register_appid(const MSIAPPID *appid, LPCWSTR app ) UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) { static const WCHAR szFileType_fmt[] = {'F','i','l','e','T','y','p','e','\','%','s','\','%','i',0}; - const WCHAR *keypath; + REGSAM access = KEY_ALL_ACCESS; MSIRECORD *uirow; HKEY hkey, hkey2, hkey3; MSICLASS *cls; @@ -760,12 +760,12 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) if (r != ERROR_SUCCESS) return r;
- if (is_64bit && package->platform == PLATFORM_INTEL) - keypath = szWow6432NodeCLSID; + if (package->platform == PLATFORM_INTEL) + access |= KEY_WOW64_32KEY; else - keypath = szCLSID; + access |= KEY_WOW64_64KEY;
- if (RegCreateKeyW(HKEY_CLASSES_ROOT, keypath, &hkey) != ERROR_SUCCESS) + if (RegCreateKeyExW( HKEY_CLASSES_ROOT, szCLSID, 0, NULL, 0, access, NULL, &hkey, NULL )) return ERROR_FUNCTION_FAILED;
LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry ) @@ -873,7 +873,6 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
if (cls->DefInprocHandler32) msi_reg_set_subkey_val( hkey2, szInprocHandler32, NULL, cls->DefInprocHandler32 ); - RegCloseKey(hkey2);
/* if there is a FileTypeMask, register the FileType */ @@ -902,7 +901,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) index ++; } } - + uirow = MSI_CreateRecord(1); MSI_RecordSetStringW( uirow, 1, cls->clsid ); MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow); @@ -915,7 +914,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package) UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package ) { static const WCHAR szFileType[] = {'F','i','l','e','T','y','p','e','\',0}; - const WCHAR *keypath; + REGSAM access = KEY_ALL_ACCESS; MSIRECORD *uirow; MSICLASS *cls; HKEY hkey, hkey2; @@ -928,13 +927,13 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package ) if (r != ERROR_SUCCESS) return r;
- if (is_64bit && package->platform == PLATFORM_INTEL) - keypath = szWow6432NodeCLSID; + if (package->platform == PLATFORM_INTEL) + access |= KEY_WOW64_32KEY; else - keypath = szCLSID; + access |= KEY_WOW64_64KEY;
- if (RegOpenKeyW( HKEY_CLASSES_ROOT, keypath, &hkey ) != ERROR_SUCCESS) - return ERROR_SUCCESS; + if (RegCreateKeyExW( HKEY_CLASSES_ROOT, szCLSID, 0, NULL, 0, access, NULL, &hkey, NULL )) + return ERROR_FUNCTION_FAILED;
LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry ) { diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index dbab8e2292..8354882e80 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -1207,7 +1207,6 @@ static const WCHAR szX64[] = {'x','6','4',0}; static const WCHAR szAMD64[] = {'A','M','D','6','4',0}; static const WCHAR szARM[] = {'A','r','m',0}; static const WCHAR szARM64[] = {'A','r','m','6','4',0}; -static const WCHAR szWow6432NodeCLSID[] = {'W','o','w','6','4','3','2','N','o','d','e','\','C','L','S','I','D',0}; static const WCHAR szStreams[] = {'_','S','t','r','e','a','m','s',0}; static const WCHAR szStorages[] = {'_','S','t','o','r','a','g','e','s',0}; static const WCHAR szMsiPublishAssemblies[] = {'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};
Hi,
Is this going to affect Wine Mono's ability to remove old versions of itself? Any automatically installed msi would've been installed by 64-bit msiexec.
On Tue, 2019-04-16 at 08:57 -0500, Vincent Povirk wrote:
Is this going to affect Wine Mono's ability to remove old versions of itself? Any automatically installed msi would've been installed by 64-bit msiexec.
I guess it might, hard to say without testing. Also note that this is not the end of it, I spotted some more places where architecture is not handled correctly.
An easy test would be to remove all wine mono packages, install 4.8.0 on current Wine (without your changes), and then install 4.8.1. That should fully replace 4.8.0.
With current Wine, I find that if I install 4.8.0 with wine64 and 4.8.1 with wine32, it doesn't replace the old package. If your changes will make msi behave like wine32 all the time, this will likely cause problems for existing prefixes.
On 04/17/2019 10:18 AM, Vincent Povirk wrote:
An easy test would be to remove all wine mono packages, install 4.8.0 on current Wine (without your changes), and then install 4.8.1. That should fully replace 4.8.0.
With current Wine, I find that if I install 4.8.0 with wine64 and 4.8.1 with wine32, it doesn't replace the old package. If your changes will make msi behave like wine32 all the time, this will likely cause problems for existing prefixes.
It's a case of a package being incorrectly installed by msi in the first place. This isn't the first time this has happened, and it won't be the last. What else can we do? Introduce workarounds for every such case?
When it's Wine itself installing the package incorrectly by default, I think we should find a way to not break the prefix.
On Wed, 2019-04-17 at 10:18 -0500, Vincent Povirk wrote:
An easy test would be to remove all wine mono packages, install 4.8.0 on current Wine (without your changes), and then install 4.8.1. That should fully replace 4.8.0.
With current Wine, I find that if I install 4.8.0 with wine64 and 4.8.1 with wine32, it doesn't replace the old package. If your changes will make msi behave like wine32 all the time, this will likely cause problems for existing prefixes.
I see an orphan Uninstall entry for 4.8.0 but it doesn't appear to cause any harm. The 4.8.1 installer did perform an uninstall of 4.8.0, it just didn't remove the Uninstall entry (which is fixed by Zeb's patch).