const char kCache[] = "cache";
const char kDataLocation[] = "data";
const char kSharedResLocation[] = "shared";
+const char kSharedCache[] = "shared/cache";
+const char kSharedData[] = "shared/data";
+const char kSharedTrusted[] = "shared/trusted";
} // namespace
}
common_installer::Step::Status StepCopyStorageDirectories::process() {
- if (context_->request_mode.get() == RequestMode::GLOBAL)
+ if (context_->request_mode.get() == RequestMode::GLOBAL) {
+ RemoveAll();
return Status::OK;
+ }
+
if (!MoveAppStorage(backup_path_,
context_->pkg_path.get(),
kDataLocation, true)) {
return true;
}
+void StepCopyStorageDirectories::RemoveAll() {
+ bs::error_code error_code;
+ bf::path data_path = context_->pkg_path.get() / kDataLocation;
+ bf::path cache_path = context_->pkg_path.get() / kCache;
+ bf::path shared_data_path = context_->pkg_path.get() / kSharedData;
+ bf::path shared_cache_path = context_->pkg_path.get() / kSharedCache;
+ bf::path shared_trusted_path = context_->pkg_path.get() / kSharedTrusted;
+
+ bf::remove_all(data_path, error_code);
+ bf::remove_all(cache_path, error_code);
+ bf::remove_all(shared_data_path, error_code);
+ bf::remove_all(shared_cache_path, error_code);
+ bf::remove_all(shared_trusted_path, error_code);
+}
+
} // namespace filesystem
} // namespace common_installer