Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f34be7c6
Commit
f34be7c6
authored
Jan 09, 2016
by
Vincent Povirk
Committed by
Alexandre Julliard
Jan 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mscoree: Remove search fallbacks when Wine Mono isn't installed.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f9036324
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
98 deletions
+8
-98
metahost.c
dlls/mscoree/metahost.c
+8
-98
No files found.
dlls/mscoree/metahost.c
View file @
f34be7c6
...
...
@@ -589,112 +589,22 @@ static BOOL find_mono_dll(LPCWSTR path, LPWSTR dll_path)
return
(
attributes
!=
INVALID_FILE_ATTRIBUTES
);
}
static
BOOL
get_mono_path_from_registry
(
LPWSTR
path
)
{
static
const
WCHAR
mono_key
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'N'
,
'o'
,
'v'
,
'e'
,
'l'
,
'l'
,
'\\'
,
'M'
,
'o'
,
'n'
,
'o'
,
0
};
static
const
WCHAR
defaul_clr
[]
=
{
'D'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
'C'
,
'L'
,
'R'
,
0
};
static
const
WCHAR
install_root
[]
=
{
'S'
,
'd'
,
'k'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'R'
,
'o'
,
'o'
,
't'
,
0
};
static
const
WCHAR
slash
[]
=
{
'\\'
,
0
};
WCHAR
version
[
64
],
version_key
[
MAX_PATH
];
DWORD
len
;
HKEY
key
;
WCHAR
dll_path
[
MAX_PATH
];
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
mono_key
,
0
,
KEY_READ
,
&
key
))
return
FALSE
;
len
=
sizeof
(
version
);
if
(
RegQueryValueExW
(
key
,
defaul_clr
,
0
,
NULL
,
(
LPBYTE
)
version
,
&
len
))
{
RegCloseKey
(
key
);
return
FALSE
;
}
RegCloseKey
(
key
);
lstrcpyW
(
version_key
,
mono_key
);
lstrcatW
(
version_key
,
slash
);
lstrcatW
(
version_key
,
version
);
if
(
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
version_key
,
0
,
KEY_READ
,
&
key
))
return
FALSE
;
len
=
sizeof
(
WCHAR
)
*
MAX_PATH
;
if
(
RegQueryValueExW
(
key
,
install_root
,
0
,
NULL
,
(
LPBYTE
)
path
,
&
len
))
{
RegCloseKey
(
key
);
return
FALSE
;
}
RegCloseKey
(
key
);
return
find_mono_dll
(
path
,
dll_path
);
}
static
BOOL
get_mono_path_from_folder
(
LPCWSTR
folder
,
LPWSTR
mono_path
)
{
static
const
WCHAR
mono_two_dot_zero
[]
=
{
'\\'
,
'm'
,
'o'
,
'n'
,
'o'
,
'-'
,
'2'
,
'.'
,
'0'
,
0
};
WCHAR
mono_dll_path
[
MAX_PATH
];
BOOL
found
=
FALSE
;
strcpyW
(
mono_path
,
folder
);
strcatW
(
mono_path
,
mono_two_dot_zero
);
found
=
find_mono_dll
(
mono_path
,
mono_dll_path
);
return
found
;
}
static
BOOL
get_mono_path
(
LPWSTR
path
)
{
static
const
WCHAR
subdir_mono
[]
=
{
'\\'
,
'm'
,
'o'
,
'n'
,
'o'
,
0
};
static
const
WCHAR
sibling_mono
[]
=
{
'\\'
,
'.'
,
'.'
,
'\\'
,
'm'
,
'o'
,
'n'
,
'o'
,
0
};
WCHAR
base_path
[
MAX_PATH
];
const
char
*
unix_data_dir
;
WCHAR
*
dos_data_dir
;
BOOL
build_tree
=
FALSE
;
static
WCHAR
*
(
CDECL
*
wine_get_dos_file_name
)(
const
char
*
);
/* First try c:\windows\mono */
static
const
WCHAR
subdir_mono
[]
=
{
'\\'
,
'm'
,
'o'
,
'n'
,
'o'
,
'\\'
,
'm'
,
'o'
,
'n'
,
'o'
,
'-'
,
'2'
,
'.'
,
'0'
,
0
};
WCHAR
base_path
[
MAX_PATH
],
mono_dll_path
[
MAX_PATH
];
/* c:\windows\mono\mono-2.0 */
GetWindowsDirectoryW
(
base_path
,
MAX_PATH
);
strcatW
(
base_path
,
subdir_mono
);
if
(
get_mono_path_from_folder
(
base_path
,
path
))
return
TRUE
;
/* Next: /usr/share/wine/mono */
unix_data_dir
=
wine_get_data_dir
();
if
(
!
unix_data_dir
)
if
(
find_mono_dll
(
base_path
,
mono_dll_path
))
{
unix_data_dir
=
wine_get_build_dir
();
build_tree
=
TRUE
;
}
if
(
unix_data_dir
)
{
if
(
!
wine_get_dos_file_name
)
wine_get_dos_file_name
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32"
),
"wine_get_dos_file_name"
);
if
(
wine_get_dos_file_name
)
{
dos_data_dir
=
wine_get_dos_file_name
(
unix_data_dir
);
if
(
dos_data_dir
)
{
strcpyW
(
base_path
,
dos_data_dir
);
strcatW
(
base_path
,
build_tree
?
sibling_mono
:
subdir_mono
);
HeapFree
(
GetProcessHeap
(),
0
,
dos_data_dir
);
if
(
get_mono_path_from_folder
(
base_path
,
path
))
return
TRUE
;
}
}
strcpyW
(
path
,
base_path
);
return
TRUE
;
}
/* Last: the registry */
return
get_mono_path_from_registry
(
path
);
return
FALSE
;
}
struct
InstalledRuntimeEnum
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment