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)
|
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;
|
LONG res;
|
||||||
LPWSTR file = NULL;
|
DWORD size, len, type;
|
||||||
DWORD index = 0, size;
|
WCHAR windir[MAX_PATH], path[MAX_PATH], *filename = NULL;
|
||||||
WCHAR ver[MAX_PATH];
|
|
||||||
WCHAR name[MAX_PATH];
|
|
||||||
WCHAR windir[MAX_PATH];
|
|
||||||
|
|
||||||
static const WCHAR fusion[] = {'f','u','s','i','o','n','.','d','l','l',0};
|
res = RegOpenKeyExW(HKEY_LOCAL_MACHINE, subkey, 0, KEY_CREATE_SUB_KEY, &netsetup);
|
||||||
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);
|
|
||||||
if (res != ERROR_SUCCESS)
|
if (res != ERROR_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
GetWindowsDirectoryW(windir, MAX_PATH);
|
if (!RegCreateKeyExW(netsetup, v4client, 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
|
||||||
|
|
||||||
ver[0] = '\0';
|
|
||||||
size = MAX_PATH;
|
|
||||||
while (RegEnumKeyExW(netsetup, index, name, &size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
|
|
||||||
{
|
{
|
||||||
index++;
|
size = sizeof(path)/sizeof(path[0]);
|
||||||
|
if (!RegQueryValueExW(hkey, installpath, NULL, &type, (BYTE *)path, &size))
|
||||||
/* verify existence of fusion.dll .Net 3.0 does not install a new one */
|
|
||||||
if (strcmpW( ver, name ) < 0)
|
|
||||||
{
|
{
|
||||||
LPWSTR check;
|
len = strlenW(path) + strlenW(fusion) + 2;
|
||||||
size = lstrlenW(windir) + lstrlenW(subdir) + lstrlenW(name) +lstrlenW(fusion) + 3;
|
if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
|
||||||
check = msi_alloc(size * sizeof(WCHAR));
|
|
||||||
|
|
||||||
if (!check)
|
strcpyW(filename, path);
|
||||||
|
strcatW(filename, szBackSlash);
|
||||||
|
strcatW(filename, fusion);
|
||||||
|
if (GetFileAttributesW(filename) != INVALID_FILE_ATTRIBUTES)
|
||||||
{
|
{
|
||||||
msi_free(file);
|
TRACE( "found %s\n", debugstr_w(filename) );
|
||||||
return NULL;
|
RegCloseKey(hkey);
|
||||||
|
RegCloseKey(netsetup);
|
||||||
|
return filename;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
RegCloseKey(hkey);
|
||||||
|
}
|
||||||
|
|
||||||
lstrcpyW(check, windir);
|
if (!RegCreateKeyExW(netsetup, v2050727, 0, NULL, 0, KEY_QUERY_VALUE, NULL, &hkey, NULL))
|
||||||
lstrcatW(check, szBackSlash);
|
{
|
||||||
lstrcatW(check, subdir);
|
RegCloseKey(hkey);
|
||||||
lstrcatW(check, name);
|
GetWindowsDirectoryW(windir, MAX_PATH);
|
||||||
lstrcatW(check, szBackSlash);
|
len = strlenW(windir) + strlenW(subdir) + strlenW(v2050727) + strlenW(fusion) + 3;
|
||||||
lstrcatW(check, fusion);
|
if (!(filename = msi_alloc(len * sizeof(WCHAR)))) return NULL;
|
||||||
|
|
||||||
if(GetFileAttributesW(check) != INVALID_FILE_ATTRIBUTES)
|
strcpyW(filename, windir);
|
||||||
{
|
strcatW(filename, szBackSlash);
|
||||||
msi_free(file);
|
strcatW(filename, subdir);
|
||||||
file = check;
|
strcatW(filename, v2050727);
|
||||||
lstrcpyW(ver, name);
|
strcatW(filename, szBackSlash);
|
||||||
}
|
strcatW(filename, fusion);
|
||||||
else
|
if (GetFileAttributesW(filename) != INVALID_FILE_ATTRIBUTES)
|
||||||
msi_free(check);
|
{
|
||||||
|
TRACE( "found %s\n", debugstr_w(filename) );
|
||||||
|
RegCloseKey(netsetup);
|
||||||
|
return filename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey(netsetup);
|
RegCloseKey(netsetup);
|
||||||
return file;
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct tagLANGANDCODEPAGE
|
typedef struct tagLANGANDCODEPAGE
|
||||||
|
|
|
@ -5652,6 +5652,11 @@ static void test_installprops(void)
|
||||||
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS got %d\n", r);
|
ok( r == ERROR_SUCCESS, "Expected ERROR_SUCCESS got %d\n", r);
|
||||||
ok(atol(buf) == res, "Expected %d, got %ld\n", res, atol(buf));
|
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)
|
if (pGetSystemInfo && pSHGetFolderPathA)
|
||||||
{
|
{
|
||||||
pGetSystemInfo(&si);
|
pGetSystemInfo(&si);
|
||||||
|
|
Loading…
Reference in New Issue