Merge branch 'tizen' of https://github.sec.samsung.net/j-h-choi/dotnet-launcher into...
[platform/core/dotnet/launcher.git] / NativeLauncher / tool / ni_common.cc
similarity index 94%
rename from NativeLauncher/installer-plugin/ni_common.cc
rename to NativeLauncher/tool/ni_common.cc
index 29f0b82..d2b7ec3 100644 (file)
@@ -400,28 +400,29 @@ void createNiUnderDirs(const std::string rootPaths[], int count, bool enableR2R,
        }
 }
 
-ni_error_e createNiUnderPkgRoot(const std::string& pkgName, bool enableR2R)
+ni_error_e createNiUnderPkgRoot(const std::string& pkgId, bool enableR2R)
 {
        std::string pkgRoot;
-       if (getRootPath(pkgName, pkgRoot) != NI_ERROR_NONE) {
-               fprintf(stderr, "Failed to get root path from [%s]\n", pkgName.c_str());
+       if (getRootPath(pkgId, pkgRoot) != NI_ERROR_NONE) {
+               fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
                return NI_ERROR_INVALID_PACKAGE;
        }
 
        std::string binDir = concatPath(pkgRoot, "bin");
        std::string libDir = concatPath(pkgRoot, "lib");
-       std::string paths[] = {binDir, libDir};
+       std::string appTAC = concatPath(binDir, ".TAC.Release");
+       std::string paths[] = {binDir, libDir, appTAC};
 
-       createNiUnderDirs(paths, 2, enableR2R, true);
+       createNiUnderDirs(paths, 3, enableR2R, true);
 
        return NI_ERROR_NONE;
 }
 
-ni_error_e createNiDllUnderPkgRoot(const std::string& pkgName, const std::string& dllPath, bool enableR2R)
+ni_error_e createNiDllUnderPkgRoot(const std::string& pkgId, const std::string& dllPath, bool enableR2R)
 {
        std::string pkgRoot;
-       if (getRootPath(pkgName, pkgRoot) < 0) {
-               fprintf(stderr, "Failed to get root path from [%s]\n", pkgName.c_str());
+       if (getRootPath(pkgId, pkgRoot) < 0) {
+               fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
                return NI_ERROR_INVALID_PACKAGE;
        }
 
@@ -457,7 +458,6 @@ void removeNiPlatform()
 void removeNiUnderDirs(const std::string rootPaths[], int count)
 {
        auto convert = [](const std::string& path, std::string name) {
-               std::string ni;
                if (isNativeImage(path)) {
                        if (remove(path.c_str())) {
                                fprintf(stderr, "Failed to remove %s\n", path.c_str());
@@ -469,11 +469,11 @@ void removeNiUnderDirs(const std::string rootPaths[], int count)
                scanFilesInDir(rootPaths[i], convert, -1);
 }
 
-ni_error_e removeNiUnderPkgRoot(const std::string& pkgName)
+ni_error_e removeNiUnderPkgRoot(const std::string& pkgId)
 {
        std::string pkgRoot;
-       if (getRootPath(pkgName, pkgRoot) < 0) {
-               fprintf(stderr, "Failed to get root path from [%s]\n", pkgName.c_str());
+       if (getRootPath(pkgId, pkgRoot) < 0) {
+               fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
                return NI_ERROR_INVALID_PACKAGE;
        }
 
@@ -527,4 +527,3 @@ ni_error_e regenerateAppNI(bool enableR2R)
        pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
        return NI_ERROR_NONE;
 }
-