refactoring launcher
[platform/core/dotnet/launcher.git] / NativeLauncher / launcher / main.cc
index c39b3e8..9bd024c 100644 (file)
 
 static std::string VersionOption("--version");
 static std::string StandaloneOption("--standalone");
-static std::string NativeOption("--native");
 
 int main(int argc, char *argv[])
 {
   int i;
   bool standalone = false;
   const char* standalonePath = nullptr;
-  bool nativeOnly = false;
 
   std::vector<char*> vargs;
 
@@ -68,22 +66,12 @@ int main(int argc, char *argv[])
       i++;
       standalonePath = argv[i];
     }
-    else if (NativeOption.compare(argv[i]) == 0)
-    {
-      nativeOnly = true;
-    }
     else
     {
       vargs.push_back(argv[i]);
     }
   }
 
-  if (!standalone && nativeOnly)
-  {
-    fprintf(stderr, "\"--native\" option must be use with \"--standalone\"\n");
-    return 1;
-  }
-
   using tizen::runtime::LauncherInterface;
   using tizen::runtime::Launchpad;
   using tizen::runtime::AppInfo;
@@ -117,15 +105,9 @@ int main(int argc, char *argv[])
       return 1;
     }
 
-    if (!nativeOnly && runtime->RunManagedLauncher() != 0)
-    {
-      _ERR("Failed to run managed launcher");
-      return 1;
-    }
-
     int args_len = vargs.size();
     char** args = &vargs[0];
-    if (runtime->Launch(approot.c_str(), standalonePath, args_len, args))
+    if (runtime->Launch(appid, approot.c_str(), standalonePath, args_len, args))
     {
         _ERR("Failed to launch");
         return 0;
@@ -141,16 +123,7 @@ int main(int argc, char *argv[])
       }
       else
       {
-        auto idle_task = [](void *data) -> Eina_Bool
-        {
-          LauncherInterface* runtime = static_cast<LauncherInterface*>(data);
-          if (runtime->RunManagedLauncher() != 0)
-          {
-            _ERR("Failed to run managed launcher");
-          }
-          return ECORE_CALLBACK_CANCEL;
-        };
-        ecore_idler_add(idle_task, runtime.get());
+        _DBG("Success to initialized");
       }
     };
 
@@ -164,7 +137,7 @@ int main(int argc, char *argv[])
       // The launchpad pass the name of exe file to the first argument.
       // For the C# spec, we have to skip this first argument.
 
-      if (runtime->Launch(info.root.c_str(), info.path.c_str(), argc-1, argv+1))
+      if (runtime->Launch(info.id.c_str(), info.root.c_str(), info.path.c_str(), argc-1, argv+1))
       {
         _ERR("Failed to launch");
       }