Check the existence of the original(.dll) file to use the --ni-reset-system option...
author최종헌/Common Platform Lab(SR)/삼성전자 <j-h.choi@samsung.com>
Thu, 22 Sep 2022 06:26:47 +0000 (15:26 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 22 Sep 2022 06:26:47 +0000 (15:26 +0900)
Change-Id: I0b8d79b399729018408b02847ced5b5b1a8849b2

NativeLauncher/tool/ni_common.cc

index 800a223..54e1c0b 100644 (file)
@@ -1102,8 +1102,13 @@ void removeNIUnderDirs(const std::string& rootPaths)
 {
        auto convert = [](const std::string& path, const std::string& filename) {
                if (isNativeImage(path)) {
-                       if (remove(path.c_str())) {
-                               _SERR("Failed to remove %s", path.c_str());
+                       std::string assemblyPath = changeExtension(path, ".ni.dll", ".dll");
+                       if (exist(assemblyPath)) {
+                               if (remove(path.c_str())) {
+                                       _SERR("Failed to remove %s", path.c_str());
+                               }
+                       } else {
+                               _SOUT("%s cannot be removed because there is no %s", path.c_str(), assemblyPath.c_str());
                        }
                }
        };