From 46ee0c92e7f4521f2b64a44d1cbc8563534a635f Mon Sep 17 00:00:00 2001 From: Fabian Terhorst Date: Wed, 12 Jun 2019 18:02:56 +0200 Subject: [PATCH] Only create executable path when executable is used --- runtime/src/CoreClr.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/src/CoreClr.cpp b/runtime/src/CoreClr.cpp index db416d4cf9..fa4f5aeadf 100644 --- a/runtime/src/CoreClr.cpp +++ b/runtime/src/CoreClr.cpp @@ -240,8 +240,6 @@ void CoreClr::CreateAppDomain(alt::IServer* server, alt::IResource* resource, co auto nativeDllPaths = alt::String(appPath) + LIST_SEPARATOR + runtimeDirectory; - auto executablePath = alt::String(appPath) + PATH_SEPARATOR + resource->GetMain(); - const char* propertyKeys[] = { "TRUSTED_PLATFORM_ASSEMBLIES", "APP_PATHS", @@ -275,6 +273,8 @@ void CoreClr::CreateAppDomain(alt::IServer* server, alt::IResource* resource, co } if (executable) { + auto executablePath = alt::String(appPath) + PATH_SEPARATOR + resource->GetMain(); + server->LogInfo(alt::String("coreclr-module: Prepare for executing assembly:") + executablePath); int exitCode = -1; const char* args[1]; @@ -288,7 +288,7 @@ void CoreClr::CreateAppDomain(alt::IServer* server, alt::IResource* resource, co 1, args, executablePath.CStr(), - (unsigned int*)&exitCode + (unsigned int*) &exitCode ); if (result < 0) { @@ -297,7 +297,7 @@ void CoreClr::CreateAppDomain(alt::IServer* server, alt::IResource* resource, co alt::String("coreclr-module: Unable to execute assembly in app path:") + executablePath); this->PrintError(server, result); } else { - server->LogInfo("coreclr-module: Assembly executed"); + server->LogInfo(alt::String("coreclr-module: Assembly executed")); char* x_str = new char[10]; sprintf(x_str, "exit code: %d", exitCode); server->LogInfo( @@ -339,7 +339,7 @@ void CoreClr::GetPath(alt::IServer* server, const char* defaultPath) { greatest = entry->d_name; continue; } - if(semver_parse(entry->d_name, &compare_version)) { + if (semver_parse(entry->d_name, &compare_version)) { server->LogInfo(alt::String("coreclr-module: invalid version found: ") + entry->d_name); continue; }