ExecuteAssembly not permit native image path
[platform/core/dotnet/launcher.git] / NativeLauncher / launcher / dotnet / dotnet_launcher.cc
index 15b74c9..4aabf42 100644 (file)
@@ -275,18 +275,6 @@ int CoreRuntime::Launch(const char* app_id, const char* root, const char* path,
     return 1;
   }
 
-  std::string cpppath(path);
-
-  if (IsManagedAssembly(cpppath) && !IsNativeImage(cpppath))
-  {
-    size_t extindex = cpppath.size() - 4;
-    cpppath = cpppath.substr(0, extindex) + ".ni" + cpppath.substr(extindex, 4);
-    if (!FileNotExist(cpppath))
-    {
-      path = cpppath.c_str();
-    }
-  }
-
   if (FileNotExist(path))
   {
     _ERR("File not exist : %s", path);
@@ -315,6 +303,18 @@ int CoreRuntime::Launch(const char* app_id, const char* root, const char* path,
   bool success = false;
   if (LaunchFunction != nullptr)
   {
+    std::string cpppath(path);
+
+    if (IsManagedAssembly(cpppath) && !IsNativeImage(cpppath))
+    {
+      size_t extindex = cpppath.size() - 4;
+      cpppath = cpppath.substr(0, extindex) + ".ni" + cpppath.substr(extindex, 4);
+      if (!FileNotExist(cpppath))
+      {
+        path = cpppath.c_str();
+      }
+    }
+
     success = LaunchFunction(root, path, argc, argv);
     if (!success)
     {