[Tizen S] Integrate app types(dotnet, dotnet-nui)
[platform/core/dotnet/launcher.git] / NativeLauncher / launcher / exec / launcher.cc
index 7f8b8d4..d7cc8e6 100644 (file)
@@ -36,9 +36,11 @@ using tizen::runtime::dotnetcore::CoreRuntime;
 #define APPID_MAX_LENGTH       (25 + 105)
 #define PRC_NAME_LENGTH                16
 
+static const char* KEY_TIZEN_UIFW = "TIZEN_UIFW";
 static std::string StandaloneOption("--standalone");
 static std::string PaddingOption("--PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE_PADDING_TO_CHANGE_CMDLINE");
 static std::string AppTypeOption("--appType");
+static std::string UIFWOption(KEY_TIZEN_UIFW);
 static std::string ProfileOption("--profile");
 static std::string GlobalizationInvariantOption("--invariant");
 
@@ -51,6 +53,7 @@ int main(int argc, char *argv[])
        bool paddingExist = false;
        bool profile = false;
        const char* appType = "dotnet";
+       const char* UIFWType = "NUI";
        const char* appRootPath = NULL;
        char appId[APPID_MAX_LENGTH] = {0,};
 
@@ -61,9 +64,10 @@ int main(int argc, char *argv[])
 
                if (GlobalizationInvariantOption.compare(argv[i]) == 0) {
                        setenv("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT", "1", 1);
+                       setenv("DOTNET_SYSTEM_GLOBALIZATION_PREDEFINED_CULTURES_ONLY", "false", 1);
                } else if (StandaloneOption.compare(argv[i]) == 0) {
                        if (i > argc - 1) {
-                               _ERR("Assembly path must be after \"--standalone\" option");
+                               _ERR("Assembly path must be after %s option", StandaloneOption.c_str());
                                return -1;
                        }
                        i++;
@@ -74,11 +78,18 @@ int main(int argc, char *argv[])
                        profile = true;
                } else if (AppTypeOption.compare(argv[i]) == 0) {
                        if (i > argc - 1) {
-                               _ERR("app type for launchpad must be after \"--appType\" option");
+                               _ERR("app type for launchpad must be after %s option", AppTypeOption.c_str());
                                return -1;
                        }
                        i++;
                        appType = argv[i];
+               } else if (UIFWOption.compare(argv[i]) == 0) {
+                       if (i > argc - 1) {
+                               _ERR("UIFW type for launchpad must be after %s option", UIFWOption.c_str());
+                               return -1;
+                       }
+                       i++;
+                       UIFWType = argv[i];
                } else {
                        vargs.push_back(argv[i]);
                }
@@ -106,6 +117,9 @@ int main(int argc, char *argv[])
        memset(argv[0], '\0', cmdlineSize);
        snprintf(argv[0], cmdlineSize - 1, "%s", standalonePath);
 
+       setenv(KEY_TIZEN_UIFW, UIFWType, 1);
+       _INFO("TIZEN_UIFW is set to %s", UIFWType);
+
        // initialize CoreRuntime
        int err = CoreRuntime::initialize(appType, LaunchMode::launcher);
        if (err) {