Use absolute path of input dll path.
authorWoongsuk Cho <ws77.cho@samsung.com>
Tue, 31 Mar 2020 04:46:18 +0000 (13:46 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Fri, 10 Apr 2020 00:45:40 +0000 (09:45 +0900)
If only the dll file name is entered as an input parameter without a path, it does not work properly.
To solve that issue, get the absolute path from dll file, and pass that to coreclr

NativeLauncher/launcher/main.cc

index 755a82b..42ca9f4 100644 (file)
@@ -78,7 +78,8 @@ extern "C" int realMain(int argc, char *argv[], const char* mode)
                char appId[APPID_MAX_LENGTH] = {0,};
                std::string appRoot;
                snprintf(appId, 16, "%s", "dotnet-launcher");
-               appRoot = baseName(argv[1]);
+               std::string absoluteDllPath = absolutePath(argv[1]);
+               appRoot = baseName(absoluteDllPath);
 
                if (runtime->initialize(true, false, appRoot.c_str()) != 0) {
                        _ERR("Failed to initialize");
@@ -87,7 +88,7 @@ extern "C" int realMain(int argc, char *argv[], const char* mode)
 
                int argsLen = vargs.size() - 1;
                char** args = &vargs[1];
-               if (runtime->launch(appId, appRoot.c_str(), argv[1], argsLen, args)) {
+               if (runtime->launch(appId, appRoot.c_str(), absoluteDllPath.c_str(), argsLen, args)) {
                        _ERR("Failed to launch");
                        return 1;
                }