Create the .res_mount directory
authorj-h.choi <j-h.choi@samsung.com>
Thu, 24 Oct 2024 07:30:29 +0000 (16:30 +0900)
committerWoongsuk <ws77.cho@samsung.com>
Wed, 4 Jun 2025 06:52:59 +0000 (15:52 +0900)
Change-Id: Id7bae9f77c41b5ff3d320a67a0de2fb277fca529

NativeLauncher/dotnet-launcher.info
NativeLauncher/inc/launcher_env.h
NativeLauncher/inc/path_manager.h
NativeLauncher/installer-plugin/dotnet_apptype_plugin.cc
NativeLauncher/util/path_manager.cc

index 1fa17291728a21d653d377099b7c8054bb97e3f6..3b4cb46a38413f679f6c16941f973e232d804db2 100644 (file)
@@ -1,6 +1,6 @@
-type="tag";name="ui-application";path="/etc/package-manager/parserlib/libdotnet_apptype_plugin.so"
-type="tag";name="service-application";path="/etc/package-manager/parserlib/libdotnet_apptype_plugin.so"
-type="tag";name="widget-application";path="/etc/package-manager/parserlib/libdotnet_apptype_plugin.so"
-type="tag";name="watch-application";path="/etc/package-manager/parserlib/libdotnet_apptype_plugin.so"
+type="tag";name="ui-application";path="/etc/package-manager/parserlib/libdotnet_apptype_plugin.so";vitalness="true"
+type="tag";name="service-application";path="/etc/package-manager/parserlib/libdotnet_apptype_plugin.so";vitalness="true"
+type="tag";name="widget-application";path="/etc/package-manager/parserlib/libdotnet_apptype_plugin.so";vitalness="true"
+type="tag";name="watch-application";path="/etc/package-manager/parserlib/libdotnet_apptype_plugin.so";vitalness="true"
 type="metadata";name="http://tizen.org/metadata/prefer_nuget_cache";path="/etc/package-manager/parserlib/metadata/libprefer_nuget_cache_plugin.so"
 type="metadata";name="http://tizen.org/metadata/prefer_dotnet_aot";path="/etc/package-manager/parserlib/metadata/libprefer_dotnet_aot_plugin.so"
index 6f385666382f76e57bdb06b5c2745678df386358..60b303cc498e0929a012cda9beba157225c851cc 100644 (file)
@@ -26,6 +26,7 @@
 #define APP_NI_SUB_DIR               ".native_image"
 #define APP_NI_SUB_TMP_DIR           ".native_image_tmp"
 #define TAC_SYMLINK_SUB_DIR          ".tac_symlink"
+#define RES_MOUNT_SUB_DIR            ".res_mount"
 #define TAC_SHA_256_INFO             ".SHA256.info"
 #define TAC_APP_LIST_DB              ".TAC.App.list.db"
 #define TAC_APP_LIST_RESTORE_DB      ".TAC.App.list.restore.db"
index ab23578a23711d3f4611698d3bc94e91cfba4b7d..b4e6f6ff0bbec21888b4fdd73ed455b5468d3917 100644 (file)
@@ -114,6 +114,12 @@ public:
         */
        const std::string& getAppRootPath();
 
+       /**
+        * @brief Get the path of .res_mount of application
+        * @return .res_mount path
+        */
+       const std::string& getAppResMountPath();
+
        /**
         * @brief Get the path of .tac_symlink of application
         * @return .tac_symlink path
@@ -171,6 +177,7 @@ private:
        std::string appNIPaths;
        std::string appCLRPaths;
        std::string nativeDllSearchingPaths;
+       std::string appResMountPath;
        std::string appTacPath;
        std::string extraDllPaths;
        int rootFD;
index 973a8069f410dd6fe36348e2845586b644c47a3d..e10ebbdf7d5987f0897ca74b05b4c23027766e49 100644 (file)
@@ -71,6 +71,27 @@ extern "C" int PKGMGR_PARSER_PLUGIN_INSTALL(xmlDocPtr doc, const char* pkgId)
 
        checkInternetPrivilegeAndDisableIPv6(pkgId, rootPath);
 
+       if (hasResControl(pkgId)) {
+               std::string binPath = concatPath(rootPath, "bin");
+               std::string resMountPath = concatPath(binPath, RES_MOUNT_SUB_DIR);
+               if (exist(resMountPath)) {
+                       return 0;
+               }
+
+               // 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++) {
+                       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;
+                       }
+                       _INFO("Retry %d. Cannot create directory [%s]", i, resMountPath.c_str());
+               }
+       }
+
        return 0;
 }
 extern "C" int PKGMGR_PARSER_PLUGIN_UPGRADE(xmlDocPtr doc, const char* pkgId)
index 2d1f41c54fc6e3cfbda86bed9a7dc9415c147c98..9d97100a88dbd68c4145fe78b4a9bc5e95dad40b 100644 (file)
@@ -62,10 +62,11 @@ 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);
        appTacPath = concatPath(appBinPath, TAC_SYMLINK_SUB_DIR);
        appPaths = appRootPath + ":" + appBinPath + ":" + appLibPath + ":" + appTacPath;
        appNIPaths = appNIBinPath + ":" + appNILibPath + ":" + appTacPath;
-       appCLRPaths = appNIPaths + ":" + appPaths;
+       appCLRPaths = appResMountPath + ":" + appNIPaths + ":" + appPaths;
 
        if (!extraDllPaths.empty()) {
                appPaths = appPaths + ":" + extraDllPaths;
@@ -115,7 +116,7 @@ PathManager::PathManager() :
        updateAppRelatedPath(appRootPath, appNIRootPath);
 
        // Set native library searching path
-       nativeDllSearchingPaths = runtimePath + ":" + __NATIVE_LIB_DIR + ":" +
+       nativeDllSearchingPaths = runtimePath + ":" + __NATIVE_LIB_DIR + ":" + concatPath(appRootPath, RES_MOUNT_SUB_DIR) + ":" +
                                  concatPath(appRootPath, "bin") + ":" + concatPath(appRootPath, "lib") + ":" +
                                  getExtraNativeLibDirs(appRootPath);
 
@@ -238,6 +239,12 @@ const std::string& PathManager::getAppNIPaths()
        return appNIPaths;
 }
 
+// return res mount path
+const std::string& PathManager::getAppResMountPath()
+{
+       return appResMountPath;
+}
+
 // return ni dll and dll searching paths for app
 const std::string& PathManager::getAppCLRPaths()
 {