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"
|
#define symlinkEntrypointExecutable "/proc/curproc/exe"
|
||||||
#endif
|
#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)
|
bool pal::find_coreclr(pal::string_t& recv)
|
||||||
{
|
{
|
||||||
pal::string_t candidate;
|
pal::string_t candidate;
|
||||||
pal::string_t test;
|
pal::string_t test;
|
||||||
|
|
||||||
// Try %LocalAppData%\dotnet
|
// Try /usr/share/dotnet and /usr/local/share/dotnet
|
||||||
if (pal::getenv(_X("LocalAppData"), candidate)) {
|
candidate.assign("/usr/share/dotnet/runtime/coreclr");
|
||||||
append_path(candidate, _X("dotnet"));
|
if (coreclr_exists_in_dir(candidate)) {
|
||||||
if (coreclr_exists_in_dir(candidate)) {
|
recv.assign(candidate);
|
||||||
recv.assign(candidate);
|
return true;
|
||||||
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@ bool pal::find_coreclr(pal::string_t& recv)
|
||||||
// Try %LocalAppData%\dotnet
|
// Try %LocalAppData%\dotnet
|
||||||
if (pal::getenv(_X("LocalAppData"), candidate)) {
|
if (pal::getenv(_X("LocalAppData"), candidate)) {
|
||||||
append_path(candidate, _X("dotnet"));
|
append_path(candidate, _X("dotnet"));
|
||||||
|
append_path(candidate, _X("runtime"));
|
||||||
|
append_path(candidate, _X("coreclr"));
|
||||||
if (coreclr_exists_in_dir(candidate)) {
|
if (coreclr_exists_in_dir(candidate)) {
|
||||||
recv.assign(candidate);
|
recv.assign(candidate);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
bool coreclr_exists_in_dir(const pal::string_t& candidate)
|
bool coreclr_exists_in_dir(const pal::string_t& candidate)
|
||||||
{
|
{
|
||||||
pal::string_t test(candidate);
|
pal::string_t test(candidate);
|
||||||
append_path(test, _X("runtime"));
|
|
||||||
append_path(test, LIBCORECLR_NAME);
|
append_path(test, LIBCORECLR_NAME);
|
||||||
trace::verbose(_X("checking for CoreCLR in default location: %s"), test.c_str());
|
trace::verbose(_X("checking for CoreCLR in default location: %s"), test.c_str());
|
||||||
return pal::file_exists(test);
|
return pal::file_exists(test);
|
||||||
|
|
Loading…
Add table
Reference in a new issue