Module: wine Branch: master Commit: 28bc76b5d3487a7a3cf26f5edea1e59472ea6916 URL: http://source.winehq.org/git/wine.git/?a=commit;h=28bc76b5d3487a7a3cf26f5ede...
Author: Aric Stewart aric@codeweavers.com Date: Wed Mar 18 14:31:14 2009 -0500
msi: Verify the existence of fusion.dll before reporting the .Net version.
Fixes an issue with .Net 3.0 where it does not install a new fusion.dll but does add a key to the registery. The fact that a new dll is not installed has been verified on windows.
---
dlls/msi/package.c | 52 ++++++++++++++++++++++++++++++++-------------------- 1 files changed, 32 insertions(+), 20 deletions(-)
diff --git a/dlls/msi/package.c b/dlls/msi/package.c index b2c46a2..ec8495f 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -220,7 +220,7 @@ static LPWSTR get_fusion_filename(MSIPACKAGE *package) { HKEY netsetup; LONG res; - LPWSTR file; + LPWSTR file = NULL; DWORD index = 0, size; WCHAR ver[MAX_PATH]; WCHAR name[MAX_PATH]; @@ -243,34 +243,46 @@ static LPWSTR get_fusion_filename(MSIPACKAGE *package) if (res != ERROR_SUCCESS) return NULL;
+ GetWindowsDirectoryW(windir, MAX_PATH); + ver[0] = '\0'; size = MAX_PATH; while (RegEnumKeyExW(netsetup, index, name, &size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) { index++; - if (lstrcmpW(ver, name) < 0) - lstrcpyW(ver, name); - }
- RegCloseKey(netsetup); - - if (!index) - return NULL; + /* verify existence of fusion.dll .Net 3.0 does not install a new one */ + if (lstrcmpW(ver, name) < 0) + { + LPWSTR check; + size = lstrlenW(windir) + lstrlenW(subdir) + lstrlenW(name) +lstrlenW(fusion) + 3; + check = msi_alloc(size * sizeof(WCHAR));
- GetWindowsDirectoryW(windir, MAX_PATH); + if (!check) + { + if (file) msi_free(file); + return NULL; + }
- size = lstrlenW(windir) + lstrlenW(subdir) + lstrlenW(ver) +lstrlenW(fusion) + 3; - file = msi_alloc(size * sizeof(WCHAR)); - if (!file) - return NULL; + lstrcpyW(check, windir); + lstrcatW(check, backslash); + lstrcatW(check, subdir); + lstrcatW(check, name); + lstrcatW(check, backslash); + lstrcatW(check, fusion);
- lstrcpyW(file, windir); - lstrcatW(file, backslash); - lstrcatW(file, subdir); - lstrcatW(file, ver); - lstrcatW(file, backslash); - lstrcatW(file, fusion); + if(GetFileAttributesW(check) != INVALID_FILE_ATTRIBUTES) + { + msi_free(file); + file = check; + lstrcpyW(ver, name); + } + else + msi_free(check); + } + }
+ RegCloseKey(netsetup); return file; }