msi: Properly set the MsiNetAssemblySupport property.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
71cf0a31d9
commit
691a7fa9fa
|
@ -528,71 +528,73 @@ done:
|
|||
|
||||
static LPWSTR get_fusion_filename(MSIPACKAGE *package)
|
||||
{
|
||||
HKEY netsetup;
|
||||
static const WCHAR fusion[] =
|
||||
{'f','u','s','i','o','n','.','d','l','l',0};
|
||||
static const WCHAR subkey[] =
|
||||
{'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\',
|
||||
'N','E','T',' ','F','r','a','m','e','w','o','r','k',' ','S','e','t','u','p','\\','N','D','P',0};
|
||||
static const WCHAR subdir[] =
|
||||
{'M','i','c','r','o','s','o','f','t','.','N','E','T','\\','F','r','a','m','e','w','o','r','k','\\',0};
|
||||
static const WCHAR v2050727[] =
|
||||
{'v','2','.','0','.','5','0','7','2','7',0};
|
||||
static const WCHAR v4client[] =
|
||||
{'v','4','\\','C','l','i','e','n','t',0};
|
||||
static const WCHAR installpath[] =
|
||||
{'I','n','s','t','a','l','l','P','a','t','h',0};
|
||||
HKEY netsetup, hkey;
|
||||
LONG res;
|
||||
LPWSTR file = NULL;
|
||||
DWORD index = 0, size;
|
||||
WCHAR ver[MAX_PATH];
|
||||
WCHAR name[MAX_PATH];
|
||||
WCHAR windir[MAX_PATH];
|
||||
DWORD size, len, type;
|
||||
WCHAR windir[MAX_PATH], path[MAX_PATH], *filename = NULL;
|
||||
|
||||
static const WCHAR fusion[] = {'f','u','s','i','o','n','.','d','l','l',0};
|
||||
static const WCHAR sub[] = {
|
||||
'S','o','f','t','w','a','r','e','\\',
|
||||
'M','i','c','r','o','s','o','f','t','\\',
|
||||
'N','E','T',' ','F','r','a','m','e','w','o','r','k',' ','S','e','t','u','p','\\',
|
||||
'N','D','P',0
|
||||
};
|
||||
static const WCHAR subdir[] = {
|
||||
'M','i','c','r','o','s','o','f','t','.','N','E','T','\\',
|
||||
'F','r','a','m','e','w','o','r','k','\\',0
|
||||
};
|
||||
|
||||
res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, sub, 0, KEY_ENUMERATE_SUB_KEYS, &netsetup);
|
||||
res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, subkey, 0, KEY_CREATE_SUB_KEY, &netsetup);
|
||||
if (res != ERROR_SUCCESS)
|
||||
return NULL;
|
||||
|
||||
if (!RegCreateKeyExW(netsetup, v4client, 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
|
||||
{
|
||||
size = sizeof(path)/sizeof(path[0]);
|
||||
if (!RegQueryValueExW(hkey, installpath, NULL, &type, (BYTE *)path, &size))
|
||||
{
|
||||
len = strlenW(path) + strlenW(fusion) + 2;
|
||||
if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
|
||||
|
||||
strcpyW(filename, path);
|
||||
strcatW(filename, szBackSlash);
|
||||
strcatW(filename, fusion);
|
||||
if (GetFileAttributesW(filename) != INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
TRACE( "found %s\n", debugstr_w(filename) );
|
||||
RegCloseKey(hkey);
|
||||
RegCloseKey(netsetup);
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
||||
if (!RegCreateKeyExW(netsetup, v2050727, 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
|
||||
{
|
||||
RegCloseKey(hkey);
|
||||
GetWindowsDirectoryW(windir, MAX_PATH);
|
||||
len = strlenW(windir) + strlenW(subdir) + strlenW(v2050727) + strlenW(fusion) + 3;
|
||||
if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
|
||||
|
||||
ver[0] = '\0';
|
||||
size = MAX_PATH;
|
||||
while (RegEnumKeyExW(netsetup, index, name, &size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
|
||||
strcpyW(filename, windir);
|
||||
strcatW(filename, szBackSlash);
|
||||
strcatW(filename, subdir);
|
||||
strcatW(filename, v2050727);
|
||||
strcatW(filename, szBackSlash);
|
||||
strcatW(filename, fusion);
|
||||
if (GetFileAttributesW(filename) != INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
index++;
|
||||
|
||||
/* verify existence of fusion.dll .Net 3.0 does not install a new one */
|
||||
if (strcmpW( ver, name ) < 0)
|
||||
{
|
||||
LPWSTR check;
|
||||
size = lstrlenW(windir) + lstrlenW(subdir) + lstrlenW(name) +lstrlenW(fusion) + 3;
|
||||
check = msi_alloc(size * sizeof(WCHAR));
|
||||
|
||||
if (!check)
|
||||
{
|
||||
msi_free(file);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lstrcpyW(check, windir);
|
||||
lstrcatW(check, szBackSlash);
|
||||
lstrcatW(check, subdir);
|
||||
lstrcatW(check, name);
|
||||
lstrcatW(check, szBackSlash);
|
||||
lstrcatW(check, fusion);
|
||||
|
||||
if(GetFileAttributesW(check) != INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
msi_free(file);
|
||||
file = check;
|
||||
lstrcpyW(ver, name);
|
||||
}
|
||||
else
|
||||
msi_free(check);
|
||||
TRACE( "found %s\n", debugstr_w(filename) );
|
||||
RegCloseKey(netsetup);
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
|
||||
RegCloseKey(netsetup);
|
||||
return file;
|
||||
return filename;
|
||||
}
|
||||
|
||||
typedef struct tagLANGANDCODEPAGE
|
||||
|
|
|
@ -5652,6 +5652,11 @@ static void test_installprops(void)
|
|||
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS got %d\n", r);
|
||||
ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
|
||||
|
||||
buf[0] = 0;
|
||||
size = MAX_PATH;
|
||||
r = MsiGetPropertyA(hpkg, "MsiNetAssemblySupport", buf, &size);
|
||||
if (r == ERROR_SUCCESS) trace( "MsiNetAssemblySupport \"%s\"\n", buf );
|
||||
|
||||
if (pGetSystemInfo && pSHGetFolderPathA)
|
||||
{
|
||||
pGetSystemInfo(&si);
|
||||
|
|
Loading…
Reference in New Issue