Mount install steps 67/65767/8 accepted/tizen/common/20160505.140404 accepted/tizen/ivi/20160506.035738 accepted/tizen/mobile/20160506.035204 accepted/tizen/tv/20160506.035529 accepted/tizen/wearable/20160506.035628 submit/tizen/20160504.074553
authorTomasz Iwanek <t.iwanek@samsung.com>
Tue, 12 Apr 2016 11:09:32 +0000 (13:09 +0200)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Wed, 4 May 2016 06:41:53 +0000 (23:41 -0700)
Mount install is run by "-w $pkgid" option.
Mount install, update mount install and deinstallation of mount-installed
package should work.

Requires:
 - https://review.tizen.org/gerrit/#/c/65361/

Change-Id: Ie5f6e238160861097359bcb5066b81365e806709

src/hybrid/hybrid_installer.cc
src/wgt/CMakeLists.txt
src/wgt/step/filesystem/step_wgt_prepare_package_directory.cc [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_prepare_package_directory.h [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_update_package_directory.cc [new file with mode: 0644]
src/wgt/step/filesystem/step_wgt_update_package_directory.h [new file with mode: 0644]
src/wgt/wgt_app_query_interface.cc
src/wgt/wgt_installer.cc

index 9727c54..e6ea1fa 100644 (file)
@@ -7,6 +7,7 @@
 #include <common/step/backup/step_backup_icons.h>
 #include <common/step/backup/step_backup_manifest.h>
 #include <common/step/backup/step_copy_backup.h>
+#include <common/step/configuration/step_block_cross_update.h>
 #include <common/step/configuration/step_configure.h>
 #include <common/step/configuration/step_fail.h>
 #include <common/step/configuration/step_parse_manifest.h>
 #include <common/step/filesystem/step_remove_icons.h>
 #include <common/step/filesystem/step_remove_per_user_storage_directories.h>
 #include <common/step/filesystem/step_remove_temporary_directory.h>
+#include <common/step/filesystem/step_remove_zip_image.h>
 #include <common/step/filesystem/step_unzip.h>
+#include <common/step/mount/step_mount_install.h>
+#include <common/step/mount/step_mount_unpacked.h>
+#include <common/step/mount/step_mount_update.h>
 #include <common/step/pkgmgr/step_check_removable.h>
 #include <common/step/pkgmgr/step_kill_apps.h>
 #include <common/step/pkgmgr/step_recover_application.h>
@@ -48,6 +53,8 @@
 
 #include <tpk/step/filesystem/step_create_symbolic_link.h>
 #include <tpk/step/filesystem/step_tpk_patch_icons.h>
+#include <tpk/step/filesystem/step_tpk_prepare_package_directory.h>
+#include <tpk/step/filesystem/step_tpk_update_package_directory.h>
 
 #include "hybrid/hybrid_backend_data.h"
 #include "hybrid/step/configuration/step_merge_tpk_config.h"
@@ -121,6 +128,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
       AddStep<ci::configuration::StepParseManifest>(
           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+      AddStep<ci::configuration::StepBlockCrossUpdate>();
       AddStep<ci::pkgmgr::StepKillApps>();
       AddStep<ci::backup::StepBackupManifest>();
       AddStep<ci::backup::StepBackupIcons>();
@@ -153,6 +161,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
       AddStep<ci::pkgmgr::StepUnregisterApplication>();
       AddStep<ci::security::StepRollbackDeinstallationSecurity>();
       AddStep<ci::filesystem::StepRemoveFiles>();
+      AddStep<ci::filesystem::StepRemoveZipImage>();
       AddStep<ci::filesystem::StepRemoveIcons>();
       AddStep<wgt::encryption::StepRemoveEncryptionData>();
       AddStep<ci::security::StepRevokeSecurity>();
@@ -181,6 +190,7 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
       AddStep<ci::configuration::StepParseManifest>(
           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+      AddStep<ci::configuration::StepBlockCrossUpdate>();
       AddStep<ci::pkgmgr::StepKillApps>();
       AddStep<ci::backup::StepBackupManifest>();
       AddStep<ci::backup::StepBackupIcons>();
@@ -219,6 +229,76 @@ HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
       AddStep<ci::filesystem::StepClearData>();
       break;
+    case ci::RequestType::MountInstall:
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<ci::mount::StepMountUnpacked>();
+      AddStep<ci::configuration::StepParseManifest>(
+          ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
+          ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+      AddStep<hybrid::configuration::StepStashTpkConfig>();
+      AddStep<hybrid::configuration::StepParse>(true);
+      AddStep<hybrid::configuration::StepMergeTpkConfig>();
+      AddStep<ci::security::StepCheckSignature>();
+      AddStep<ci::security::StepPrivilegeCompatibility>();
+      AddStep<wgt::security::StepCheckSettingsLevel>();
+      AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+      AddStep<hybrid::encryption::StepEncryptResources>();
+      AddStep<ci::security::StepRollbackInstallationSecurity>();
+      AddStep<ci::mount::StepMountInstall>();
+      AddStep<tpk::filesystem::StepTpkPreparePackageDirectory>();
+      AddStep<ci::filesystem::StepCopyTep>();
+      AddStep<tpk::filesystem::StepTpkPatchIcons>();
+      AddStep<wgt::filesystem::StepWgtPatchIcons>();
+      AddStep<ci::filesystem::StepCreateIcons>();
+      AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+      AddStep<ci::filesystem::StepCreateStorageDirectories>();
+      AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+      AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+      AddStep<wgt::pkgmgr::StepGenerateXml>();
+      AddStep<ci::pkgmgr::StepRunParserPlugin>(
+          ci::Plugin::ActionType::Install);
+      AddStep<ci::pkgmgr::StepRegisterApplication>();
+      AddStep<ci::security::StepRegisterSecurity>();
+      AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
+      break;
+    case ci::RequestType::MountUpdate:
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<ci::mount::StepMountUnpacked>();
+      AddStep<ci::configuration::StepParseManifest>(
+          ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
+          ci::configuration::StepParseManifest::StoreLocation::NORMAL);
+      AddStep<hybrid::configuration::StepStashTpkConfig>();
+      AddStep<hybrid::configuration::StepParse>(true);
+      AddStep<hybrid::configuration::StepMergeTpkConfig>();
+      AddStep<ci::security::StepCheckSignature>();
+      AddStep<ci::security::StepPrivilegeCompatibility>();
+      AddStep<wgt::security::StepCheckSettingsLevel>();
+      AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+      AddStep<hybrid::encryption::StepEncryptResources>();
+      AddStep<ci::security::StepRollbackInstallationSecurity>();
+      AddStep<ci::configuration::StepParseManifest>(
+          ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+          ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+      AddStep<ci::configuration::StepBlockCrossUpdate>();
+      AddStep<ci::pkgmgr::StepKillApps>();
+      AddStep<ci::backup::StepBackupManifest>();
+      AddStep<ci::backup::StepBackupIcons>();
+      AddStep<ci::mount::StepMountUpdate>();
+      AddStep<tpk::filesystem::StepTpkUpdatePackageDirectory>();
+      AddStep<ci::filesystem::StepCopyTep>();
+      AddStep<ci::pkgmgr::StepUpdateTep>();
+      AddStep<tpk::filesystem::StepTpkPatchIcons>();
+      AddStep<wgt::filesystem::StepWgtPatchIcons>();
+      AddStep<ci::filesystem::StepCreateIcons>();
+      AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+      AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+      AddStep<tpk::filesystem::StepCreateSymbolicLink>();
+      AddStep<ci::security::StepUpdateSecurity>();
+      AddStep<wgt::pkgmgr::StepGenerateXml>();
+      AddStep<ci::pkgmgr::StepUpdateApplication>();
+      AddStep<ci::pkgmgr::StepRunParserPlugin>(
+          ci::Plugin::ActionType::Upgrade);
+      break;
     default:
       AddStep<ci::configuration::StepFail>();
       break;
index 5ab8b00..41de461 100644 (file)
@@ -7,7 +7,9 @@ SET(SRCS
   step/filesystem/step_create_symbolic_link.cc
   step/filesystem/step_wgt_patch_icons.cc
   step/filesystem/step_wgt_patch_storage_directories.cc
+  step/filesystem/step_wgt_prepare_package_directory.cc
   step/filesystem/step_wgt_resource_directory.cc
+  step/filesystem/step_wgt_update_package_directory.cc
   step/pkgmgr/step_generate_xml.cc
   step/rds/step_wgt_rds_modify.cc
   step/security/step_add_default_privileges.cc
diff --git a/src/wgt/step/filesystem/step_wgt_prepare_package_directory.cc b/src/wgt/step/filesystem/step_wgt_prepare_package_directory.cc
new file mode 100644 (file)
index 0000000..fc4907b
--- /dev/null
@@ -0,0 +1,74 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/filesystem/step_wgt_prepare_package_directory.h"
+
+#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <boost/system/system_error.hpp>
+
+#include <common/backup_paths.h>
+#include <common/utils/file_util.h>
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+namespace ci = common_installer;
+
+namespace {
+
+const char kResWgtDirectory[] = "res/wgt";
+
+}  // namespace
+
+namespace wgt {
+namespace filesystem {
+
+ci::Step::Status StepWgtPreparePackageDirectory::CreateSymlinkToMountPoint() {
+  bs::error_code error;
+  bf::path mount_point = ci::GetMountLocation(context_->pkg_path.get());
+  bf::path res_wgt_link = context_->pkg_path.get() / kResWgtDirectory;
+  if (bf::exists(res_wgt_link)) {
+    if (!bf::is_symlink(res_wgt_link)) {
+      LOG(ERROR) << res_wgt_link << " is not symlink. Cannot proceed";
+      return Status::APP_DIR_ERROR;
+    }
+    bf::remove(res_wgt_link, error);
+    if (error) {
+      LOG(ERROR) << "Failed to remote old symlink to wgt resource directory";
+      return Status::APP_DIR_ERROR;
+    }
+  } else {
+    bf::create_directories(res_wgt_link.parent_path(), error);
+    if (error) {
+      LOG(ERROR) << "Failed to create " << kResWgtDirectory << " directory";
+      return Status::APP_DIR_ERROR;
+    }
+  }
+  bf::create_symlink(mount_point, res_wgt_link, error);
+  if (error) {
+    LOG(ERROR) << "Failed to create symlink to widget image";
+    return Status::APP_DIR_ERROR;
+  }
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtPreparePackageDirectory::process() {
+  Status status = CreateSymlinkToMountPoint();
+  if (status != Status::OK)
+    return status;
+  LOG(DEBUG) << "Symlink to mount point created";
+
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtPreparePackageDirectory::precheck() {
+  if (context_->pkg_path.get().empty()) {
+    LOG(ERROR) << "Package installation path is not set";
+    return Status::INVALID_VALUE;
+  }
+  return Status::OK;
+}
+
+}  // namespace filesystem
+}  // namespace wgt
diff --git a/src/wgt/step/filesystem/step_wgt_prepare_package_directory.h b/src/wgt/step/filesystem/step_wgt_prepare_package_directory.h
new file mode 100644 (file)
index 0000000..6d35f30
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_
+#define WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include <boost/filesystem/path.hpp>
+#include <pkgmgrinfo_basic.h>
+
+#include <string>
+
+#include "common/installer_context.h"
+#include "common/step/step.h"
+
+namespace wgt {
+namespace filesystem {
+
+/**
+ * \brief Responsible for adjusting package directory after mounting zip package
+ *        by StepMountInstall or StepMountUpdate
+ *
+ * This step will preserve old application symlinks in bin/ directory.
+ */
+class StepWgtPreparePackageDirectory : public common_installer::Step {
+ public:
+  using Step::Step;
+
+  Status process() override;
+  Status clean() override { return Status::OK; }
+  Status undo() override { return Status::OK; }
+  Status precheck() override;
+
+ private:
+  Status CreateSymlinkToMountPoint();
+
+  SCOPE_LOG_TAG(WgtPreparePackageDirectory)
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // WGT_STEP_FILESYSTEM_STEP_WGT_PREPARE_PACKAGE_DIRECTORY_H_
diff --git a/src/wgt/step/filesystem/step_wgt_update_package_directory.cc b/src/wgt/step/filesystem/step_wgt_update_package_directory.cc
new file mode 100644 (file)
index 0000000..0aadad5
--- /dev/null
@@ -0,0 +1,134 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "wgt/step/filesystem/step_wgt_update_package_directory.h"
+
+#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <boost/system/error_code.hpp>
+
+#include <common/backup_paths.h>
+#include <common/utils/file_util.h>
+
+namespace bf = boost::filesystem;
+namespace bs = boost::system;
+namespace ci = common_installer;
+
+namespace {
+
+const char* kBackupEntries[] = {
+  "bin",
+  "shared/res"
+};
+
+bool MoveCreateDir(const bf::path& source, const bf::path& destination) {
+  if (!bf::exists(destination.parent_path())) {
+    bs::error_code error;
+    bf::create_directories(destination.parent_path(), error);
+    if (error) {
+      LOG(ERROR) << "Cannot create directory: " << destination.parent_path();
+      return false;
+    }
+  }
+  if (!ci::MoveDir(source, destination)) {
+    LOG(ERROR) << "Failed to move directory " << destination;
+    return false;
+  }
+  return true;
+}
+
+}  // namespace
+
+namespace wgt {
+namespace filesystem {
+
+ci::Step::Status
+StepWgtUpdatePackageDirectory::CreateBackupOfDirectories() {
+  bf::path backup_path =
+      ci::GetBackupPathForPackagePath(context_->pkg_path.get());
+  for (auto& entry : kBackupEntries) {
+    bf::path directory = context_->pkg_path.get() / entry;
+    if (!bf::exists(directory))
+      continue;
+    LOG(DEBUG) << "Backup directory entry: " << entry;
+    bf::path directory_backup = backup_path / entry;
+    if (!MoveCreateDir(directory, directory_backup)) {
+      LOG(ERROR) << "Failed to create backup directory "
+                 << directory_backup;
+      return Status::APP_DIR_ERROR;
+    }
+  }
+  return Status::OK;
+}
+
+ci::Step::Status
+StepWgtUpdatePackageDirectory::RecoverBackupOfDirectories() {
+  bf::path backup_path =
+      ci::GetBackupPathForPackagePath(context_->pkg_path.get());
+
+  // skip if there is no backup of directories
+  if (!bf::exists(backup_path))
+    return Status::OK;
+
+  for (auto& entry : kBackupEntries) {
+    bf::path directory = context_->pkg_path.get() / entry;
+    bf::path directory_backup = backup_path / entry;
+    if (!bf::exists(directory_backup))
+        continue;
+    LOG(DEBUG) << "Recover directory entry: " << entry;
+    if (!ci::MoveDir(directory_backup, directory)) {
+      LOG(ERROR) << "Failed to restore directory backup "
+                 << directory_backup;
+      return Status::APP_DIR_ERROR;
+    }
+  }
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtUpdatePackageDirectory::process() {
+  auto status = CreateBackupOfDirectories();
+  if (status != Status::OK)
+    return status;
+  LOG(DEBUG) << "Directory backups created";
+
+  status = StepWgtPreparePackageDirectory::process();
+  if (status != Status::OK)
+    return status;
+
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtUpdatePackageDirectory::clean() {
+  bf::path backup_path =
+      ci::GetBackupPathForPackagePath(context_->pkg_path.get());
+  if (bf::exists(backup_path)) {
+    bs::error_code error;
+    bf::remove_all(backup_path, error);
+    if (error) {
+      LOG(ERROR) << "Failed to remove backup directories";
+      return Status::APP_DIR_ERROR;
+    }
+  }
+  return Status::OK;
+}
+
+ci::Step::Status StepWgtUpdatePackageDirectory::undo() {
+  Status status = RecoverBackupOfDirectories();
+  if (status != Status::OK)
+    return status;
+  bf::path backup_path =
+      ci::GetBackupPathForPackagePath(context_->pkg_path.get());
+  if (bf::exists(backup_path)) {
+    bs::error_code error;
+    bf::remove_all(backup_path, error);
+    if (error) {
+      LOG(ERROR) << "Failed to remove backup directories";
+      return Status::APP_DIR_ERROR;
+    }
+  }
+  return Status::OK;
+}
+
+}  // namespace filesystem
+}  // namespace wgt
diff --git a/src/wgt/step/filesystem/step_wgt_update_package_directory.h b/src/wgt/step/filesystem/step_wgt_update_package_directory.h
new file mode 100644 (file)
index 0000000..aa15c02
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#ifndef WGT_STEP_FILESYSTEM_STEP_WGT_UPDATE_PACKAGE_DIRECTORY_H_
+#define WGT_STEP_FILESYSTEM_STEP_WGT_UPDATE_PACKAGE_DIRECTORY_H_
+
+#include <manifest_parser/utils/logging.h>
+
+#include "wgt/step/filesystem/step_wgt_prepare_package_directory.h"
+
+namespace wgt {
+namespace filesystem {
+
+class StepWgtUpdatePackageDirectory : public StepWgtPreparePackageDirectory {
+ public:
+  using StepWgtPreparePackageDirectory::StepWgtPreparePackageDirectory;
+
+  Status process() override;
+  Status undo() override;
+  Status clean() override;
+
+ private:
+  Status CreateBackupOfDirectories();
+  Status RecoverBackupOfDirectories();
+
+  SCOPE_LOG_TAG(WgtUpdatePackageDirectory)
+};
+
+}  // namespace filesystem
+}  // namespace wgt
+
+#endif  // WGT_STEP_FILESYSTEM_STEP_WGT_UPDATE_PACKAGE_DIRECTORY_H_
index 68da917..02678ee 100644 (file)
@@ -40,7 +40,8 @@ std::string GetInstallationRequestInfo(int argc, char** argv) {
   std::string path;
   for (int i = 0; i < argc; ++i) {
     if (!strcmp(argv[i], "-i") || !strcmp(argv[i], "-r") ||
-        !strcmp(argv[i], "-d") || !strcmp(argv[i], "-b")) {
+        !strcmp(argv[i], "-d") || !strcmp(argv[i], "-b") ||
+        !strcmp(argv[i], "-w")) {
       if (i + 1 < argc) {
         path = argv[i + 1];
         break;
index 1ba2c06..6fdaa51 100644 (file)
@@ -9,6 +9,7 @@
 #include <common/step/backup/step_backup_icons.h>
 #include <common/step/backup/step_backup_manifest.h>
 #include <common/step/backup/step_copy_backup.h>
+#include <common/step/configuration/step_block_cross_update.h>
 #include <common/step/configuration/step_configure.h>
 #include <common/step/configuration/step_fail.h>
 #include <common/step/configuration/step_parse_manifest.h>
 #include <common/step/filesystem/step_remove_icons.h>
 #include <common/step/filesystem/step_remove_per_user_storage_directories.h>
 #include <common/step/filesystem/step_remove_temporary_directory.h>
+#include <common/step/filesystem/step_remove_zip_image.h>
 #include <common/step/filesystem/step_unzip.h>
+#include <common/step/mount/step_mount_install.h>
+#include <common/step/mount/step_mount_unpacked.h>
+#include <common/step/mount/step_mount_update.h>
 #include <common/step/pkgmgr/step_check_blacklist.h>
 #include <common/step/pkgmgr/step_check_removable.h>
 #include <common/step/pkgmgr/step_kill_apps.h>
@@ -61,7 +66,9 @@
 #include "wgt/step/filesystem/step_create_symbolic_link.h"
 #include "wgt/step/filesystem/step_wgt_patch_icons.h"
 #include "wgt/step/filesystem/step_wgt_patch_storage_directories.h"
+#include "wgt/step/filesystem/step_wgt_prepare_package_directory.h"
 #include "wgt/step/filesystem/step_wgt_resource_directory.h"
+#include "wgt/step/filesystem/step_wgt_update_package_directory.h"
 #include "wgt/step/pkgmgr/step_generate_xml.h"
 #include "wgt/step/rds/step_wgt_rds_modify.h"
 #include "wgt/step/security/step_add_default_privileges.h"
@@ -122,6 +129,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::configuration::StepParseManifest>(
           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+      AddStep<ci::configuration::StepBlockCrossUpdate>();
       AddStep<ci::pkgmgr::StepKillApps>();
       AddStep<ci::backup::StepBackupManifest>();
       AddStep<ci::backup::StepBackupIcons>();
@@ -153,6 +161,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::pkgmgr::StepUnregisterApplication>();
       AddStep<ci::security::StepRollbackDeinstallationSecurity>();
       AddStep<ci::filesystem::StepRemoveFiles>();
+      AddStep<ci::filesystem::StepRemoveZipImage>();
       AddStep<ci::filesystem::StepRemoveIcons>();
       AddStep<wgt::encryption::StepRemoveEncryptionData>();
       AddStep<ci::security::StepRevokeSecurity>();
@@ -166,6 +175,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::configuration::StepParseManifest>(
           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+      AddStep<ci::configuration::StepBlockCrossUpdate>();
       AddStep<ci::pkgmgr::StepCheckBlacklist>();
       AddStep<ci::rds::StepRDSParse>();
       AddStep<wgt::rds::StepWgtRDSModify>();
@@ -191,6 +201,7 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::configuration::StepParseManifest>(
           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+      AddStep<ci::configuration::StepBlockCrossUpdate>();
       AddStep<ci::pkgmgr::StepKillApps>();
       AddStep<ci::backup::StepBackupManifest>();
       AddStep<ci::backup::StepBackupIcons>();
@@ -225,6 +236,65 @@ WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
       AddStep<ci::filesystem::StepClearData>();
       break;
     }
+    case ci::RequestType::MountInstall: {
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<ci::mount::StepMountUnpacked>();
+      AddStep<wgt::configuration::StepParse>(true);
+      AddStep<ci::pkgmgr::StepCheckBlacklist>();
+      AddStep<ci::security::StepCheckSignature>();
+      AddStep<ci::security::StepPrivilegeCompatibility>();
+      AddStep<wgt::security::StepCheckSettingsLevel>();
+      AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+      AddStep<wgt::encryption::StepEncryptResources>();
+      AddStep<ci::security::StepRollbackInstallationSecurity>();
+      AddStep<ci::mount::StepMountInstall>();
+      AddStep<wgt::filesystem::StepWgtPreparePackageDirectory>();
+      AddStep<ci::filesystem::StepCopyTep>();
+      AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+      AddStep<ci::filesystem::StepCreateStorageDirectories>();
+      AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+      AddStep<wgt::filesystem::StepWgtPatchIcons>();
+      AddStep<ci::filesystem::StepCreateIcons>();
+      AddStep<wgt::pkgmgr::StepGenerateXml>();
+      AddStep<ci::pkgmgr::StepRegisterApplication>();
+      AddStep<ci::pkgmgr::StepRunParserPlugin>(
+          ci::Plugin::ActionType::Install);
+      AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
+      AddStep<ci::security::StepRegisterSecurity>();
+      break;
+    }
+    case ci::RequestType::MountUpdate: {
+      AddStep<ci::configuration::StepConfigure>(pkgmgr_);
+      AddStep<ci::mount::StepMountUnpacked>();
+      AddStep<wgt::configuration::StepParse>(true);
+      AddStep<ci::pkgmgr::StepCheckBlacklist>();
+      AddStep<ci::security::StepCheckSignature>();
+      AddStep<ci::security::StepPrivilegeCompatibility>();
+      AddStep<wgt::security::StepCheckSettingsLevel>();
+      AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
+      AddStep<ci::security::StepCheckOldCertificate>();
+      AddStep<ci::configuration::StepParseManifest>(
+          ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
+          ci::configuration::StepParseManifest::StoreLocation::BACKUP);
+      AddStep<ci::configuration::StepBlockCrossUpdate>();
+      AddStep<ci::pkgmgr::StepKillApps>();
+      AddStep<ci::backup::StepBackupManifest>();
+      AddStep<ci::backup::StepBackupIcons>();
+      AddStep<ci::mount::StepMountUpdate>();
+      AddStep<wgt::filesystem::StepWgtUpdatePackageDirectory>();
+      AddStep<ci::filesystem::StepCopyTep>();
+      AddStep<ci::pkgmgr::StepUpdateTep>();
+      AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
+      AddStep<wgt::filesystem::StepCreateSymbolicLink>();
+      AddStep<wgt::filesystem::StepWgtPatchIcons>();
+      AddStep<ci::filesystem::StepCreateIcons>();
+      AddStep<ci::security::StepUpdateSecurity>();
+      AddStep<wgt::pkgmgr::StepGenerateXml>();
+      AddStep<ci::pkgmgr::StepRunParserPlugin>(
+          ci::Plugin::ActionType::Upgrade);
+      AddStep<ci::pkgmgr::StepUpdateApplication>();
+      break;
+    }
     default: {
       AddStep<ci::configuration::StepFail>();
     }