From: j-h.choi Date: Fri, 21 Feb 2025 04:42:32 +0000 (+0900) Subject: Separate .res_mount path(/lib, /gadget, /service) X-Git-Tag: accepted/tizen/unified/20250304.070226^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7af58e2f10dcf37bbc5994848ec1af0e2ebab8d;p=platform%2Fcore%2Fdotnet%2Flauncher.git Separate .res_mount path(/lib, /gadget, /service) --- diff --git a/NativeLauncher/installer-plugin/dotnet_apptype_plugin.cc b/NativeLauncher/installer-plugin/dotnet_apptype_plugin.cc index e10ebbd..dc97502 100644 --- a/NativeLauncher/installer-plugin/dotnet_apptype_plugin.cc +++ b/NativeLauncher/installer-plugin/dotnet_apptype_plugin.cc @@ -73,22 +73,34 @@ extern "C" int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr doc, const char* pkgId) if (hasResControl(pkgId)) { std::string binPath = concatPath(rootPath, "bin"); - std::string resMountPath = concatPath(binPath, RES_MOUNT_SUB_DIR); - if (exist(resMountPath)) { - return 0; - } + std::string resMount = concatPath(binPath, RES_MOUNT_SUB_DIR); + std::string resMountGadgetPath = concatPath(resMount, "gadget"); + std::string resMountServicePath = concatPath(resMount, "service"); + std::string resMountLibPath = concatPath(resMount, "lib"); + std::vector resMountPaths = {resMount, resMountGadgetPath, resMountServicePath, resMountLibPath}; // Create a .res_mount folder 3 times to prevent malfunctions in app execution. // If folder creation still fails, the app installation is processed to fail. for (int i = 1; i <= 4; i++) { + resMountPaths.erase(std::remove_if(resMountPaths.begin(), resMountPaths.end(), [](const std::string& path) { + return exist(path); + }), resMountPaths.end()); + + if (resMountPaths.size() == 0) { + return 0; + } + if (i == 4) { _ERR("The .res_mount folder could not be created despite 3 attempts. Stop installing the [%s]", pkgId); return -1; } - if (createDir(resMountPath)) { - return 0; + + for (auto &path : resMountPaths) { + if (exist(path) || createDir(path)) { + continue; + } + _INFO("Retry %d. Cannot create directory [%s]", i, path.c_str()); } - _INFO("Retry %d. Cannot create directory [%s]", i, resMountPath.c_str()); } } diff --git a/NativeLauncher/util/path_manager.cc b/NativeLauncher/util/path_manager.cc index 9d97100..19dde34 100644 --- a/NativeLauncher/util/path_manager.cc +++ b/NativeLauncher/util/path_manager.cc @@ -62,7 +62,12 @@ void PathManager::updateAppRelatedPath(const std::string& appRootPath, const std std::string appNIBinPath = concatPath(concatPath(appNIRootPath, "bin"), APP_NI_SUB_DIR); std::string appNILibPath = concatPath(concatPath(appNIRootPath, "lib"), APP_NI_SUB_DIR); - appResMountPath = concatPath(appBinPath, RES_MOUNT_SUB_DIR); + std::string resMount = concatPath(appBinPath, RES_MOUNT_SUB_DIR); + std::string resMountGadget = concatPath(resMount, "gadget"); + std::string resMountService = concatPath(resMount, "service"); + std::string resMountLib = concatPath(resMount, "lib"); + + appResMountPath = resMountGadget + ":" + resMountService + ":" + resMountLib; appTacPath = concatPath(appBinPath, TAC_SYMLINK_SUB_DIR); appPaths = appRootPath + ":" + appBinPath + ":" + appLibPath + ":" + appTacPath; appNIPaths = appNIBinPath + ":" + appNILibPath + ":" + appTacPath;