Corehost changes for linux/mac default installations
This commit is contained in:
parent
c14e512a03
commit
f9dda0ca3a
3 changed files with 12 additions and 17 deletions
|
@ -19,29 +19,23 @@
|
|||
#define symlinkEntrypointExecutable "/proc/curproc/exe"
|
||||
#endif
|
||||
|
||||
bool coreclr_exists_in_dir(const pal::string_t& candidate)
|
||||
{
|
||||
pal::string_t test(candidate);
|
||||
append_path(test, _X("runtime"));
|
||||
append_path(test, LIBCORECLR_NAME);
|
||||
return pal::file_exists(test);
|
||||
}
|
||||
|
||||
bool pal::find_coreclr(pal::string_t& recv)
|
||||
{
|
||||
pal::string_t candidate;
|
||||
pal::string_t test;
|
||||
|
||||
// Try %LocalAppData%\dotnet
|
||||
if (pal::getenv(_X("LocalAppData"), candidate)) {
|
||||
append_path(candidate, _X("dotnet"));
|
||||
// Try /usr/share/dotnet and /usr/local/share/dotnet
|
||||
candidate.assign("/usr/share/dotnet/runtime/coreclr");
|
||||
if (coreclr_exists_in_dir(candidate)) {
|
||||
recv.assign(candidate);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Try somewhere in Program Files, see https://github.com/dotnet/cli/issues/249
|
||||
candidate.assign("/usr/local/share/dotnet/runtime/coreclr");
|
||||
if (coreclr_exists_in_dir(candidate)) {
|
||||
recv.assign(candidate);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@ bool pal::find_coreclr(pal::string_t& recv)
|
|||
// Try %LocalAppData%\dotnet
|
||||
if (pal::getenv(_X("LocalAppData"), candidate)) {
|
||||
append_path(candidate, _X("dotnet"));
|
||||
append_path(candidate, _X("runtime"));
|
||||
append_path(candidate, _X("coreclr"));
|
||||
if (coreclr_exists_in_dir(candidate)) {
|
||||
recv.assign(candidate);
|
||||
return true;
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
bool coreclr_exists_in_dir(const pal::string_t& candidate)
|
||||
{
|
||||
pal::string_t test(candidate);
|
||||
append_path(test, _X("runtime"));
|
||||
append_path(test, LIBCORECLR_NAME);
|
||||
trace::verbose(_X("checking for CoreCLR in default location: %s"), test.c_str());
|
||||
return pal::file_exists(test);
|
||||
|
|
Loading…
Add table
Reference in a new issue