[Release] wrt-installer_0.1.54
[framework/web/wrt-installer.git] / src / jobs / widget_install / task_update_files.cpp
index 69b7053..12af068 100644 (file)
@@ -71,6 +71,9 @@ void TaskUpdateFiles::StepBackupDirectory()
     LogDebug("backup resource directory path : " << backPath);
     std::string pkgPath = m_context.locations->getPackageInstallationDir();
 
+    if (0 == access(backPath.c_str(), F_OK)) {
+        WrtUtilRemove(backPath);
+    }
     LogDebug("copy : " << pkgPath << " to " << backPath);
     if ((rename(pkgPath.c_str(), backPath.c_str())) != 0) {
         LogError("Failed to rename " << pkgPath << " to " << backPath);