The Pre-Compiled app skips the TAC (#444)
[platform/core/dotnet/launcher.git] / NativeLauncher / tool / ni_common.cc
index 9fe6e18..ecfeee2 100644 (file)
@@ -669,7 +669,7 @@ static ni_error_e createCoreLibNI(NIOption* opt)
                                if (rename(niTmpCoreLib.c_str(), coreLib.c_str())) {
                                        _SERR("Failed to rename from System.Private.CoreLib.ni.dll.tmp to Private.CoreLib.dll");
                                        return NI_ERROR_CORE_NI_FILE;
-                               }                               
+                               }
                        } else {
                                if (rename(niCoreLib.c_str(), coreLib.c_str())) {
                                        _SERR("Failed to rename from System.Private.CoreLib.ni.dll to Private.CoreLib.dll");
@@ -1191,6 +1191,7 @@ ni_error_e regenerateAppNI(NIOption* opt)
 static int regenTacCb(pkgmgrinfo_appinfo_h handle, void *userData)
 {
        char *pkgId = NULL;
+       char *root = NULL;
        NIOption **pOpt = (NIOption**)userData;
 
        int ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgId);
@@ -1199,6 +1200,18 @@ static int regenTacCb(pkgmgrinfo_appinfo_h handle, void *userData)
                return -1;
        }
 
+       ret = pkgmgrinfo_appinfo_get_root_path(handle, &root);
+       if (ret != PMINFO_R_OK) {
+               _SERR("Failed to get root path");
+               return -1;
+       }
+
+       std::string binPath = concatPath(std::string(root), "bin");
+       if (exist(concatPath(binPath, PRE_COMPILED_PACKAGE_FILE))) {
+               _INFO("The %s is a Pre-Compiled package. So, skip the TAC", pkgId);
+               return 0;
+       }
+
        sqlite3 *tac_db = openDB(TAC_APP_LIST_DB);
        if (!tac_db) {
                _SERR("Sqlite open error");