1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
5 #ifndef COMMON_STEP_BACKUP_STEP_COPY_BACKUP_H_
6 #define COMMON_STEP_BACKUP_STEP_COPY_BACKUP_H_
8 #include <manifest_parser/utils/logging.h>
12 #include "common/installer_context.h"
13 #include "common/step/step.h"
15 namespace common_installer {
19 * \brief Responsible for backuping original package resources during
20 * update or uninstallation and copying new content of the package.
21 * Used by WGT and TPK backend
23 class StepCopyBackup : public Step {
28 * \brief main logic of creating backup and copying new content
32 Status process() override;
35 * \brief removing backup files
37 * \return Status::OK if success, Status::ERROR otherwise
39 Status clean() override;
42 * \brief Restoring original pacakge files
44 * \return Status::OK if success, Status::Error otherwise
46 Status undo() override;
49 * \brief checks if necessary paths are available
51 * \return Status::OK if success, Status::Error otherwise
53 Status precheck() override;
59 bool CleanBackupDirectory();
60 bool RollbackApplicationDirectory();
61 bool MoveMountPointContent(const std::filesystem::path& from,
62 const std::filesystem::path& to);
63 void AddRecoveryInfo();
64 bool ShouldBackupSharedRes();
66 std::filesystem::path install_path_;
67 std::filesystem::path backup_path_;
73 } // namespace common_installer
75 #endif // COMMON_STEP_BACKUP_STEP_COPY_BACKUP_H_