: AppInstaller("wgt", pkgmgr) {
context_->cross_app_rules.set(true);
context_->backend_data.set(new HybridBackendData());
+}
- switch (pkgmgr_->GetRequestType()) {
- case ci::RequestType::Install:
+void HybridInstaller::InstallSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::filesystem::StepUnzip>();
AddStep<ci::configuration::StepParseManifest>(
wgt::filesystem::HybridAdditionalSharedDirs);
AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
- break;
- case ci::RequestType::Update:
+}
+
+void HybridInstaller::UpdateSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::filesystem::StepUnzip>();
AddStep<ci::configuration::StepParseManifest>(
ci::Plugin::ActionType::Upgrade);
AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
- break;
- case ci::RequestType::Uninstall:
+}
+
+void HybridInstaller::UninstallSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::pkgmgr::StepCheckRestriction>();
AddStep<ci::pkgmgr::StepCheckRemovable>();
AddStep<ci::security::StepRevokeSecurity>();
AddStep<ci::pkgmgr::StepRemoveManifest>();
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
- break;
- case ci::RequestType::Reinstall:
+}
+
+void HybridInstaller::ReinstallSteps() {
// RDS is not supported for hybrid apps
AddStep<ci::configuration::StepFail>();
- break;
- case ci::RequestType::Delta:
+}
+
+void HybridInstaller::DeltaSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::filesystem::StepUnzip>();
AddStep<ci::configuration::StepParseManifest>(
ci::Plugin::ActionType::Upgrade);
AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
- break;
- case ci::RequestType::Recovery:
+}
+
+void HybridInstaller::RecoverySteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::recovery::StepOpenRecoveryFile>();
AddStep<ci::configuration::StepParseManifest>(
AddStep<ci::pkgmgr::StepRecoverApplication>();
AddStep<ci::filesystem::StepRecoverChangeOwner>();
AddStep<ci::security::StepRecoverSecurity>();
- break;
- case ci::RequestType::MountInstall:
+}
+
+void HybridInstaller::MountInstallSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::mount::StepMountUnpacked>();
AddStep<ci::configuration::StepParseManifest>(
wgt::filesystem::HybridAdditionalSharedDirs);
AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
- break;
- case ci::RequestType::MountUpdate:
+}
+
+void HybridInstaller::MountUpdateSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::mount::StepMountUnpacked>();
AddStep<ci::configuration::StepParseManifest>(
ci::Plugin::ActionType::Upgrade);
AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
- break;
- case ci::RequestType::ManifestDirectInstall:
+}
+
+void HybridInstaller::ManifestDirectInstallSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::configuration::StepParseManifest>(
ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
wgt::filesystem::HybridAdditionalSharedDirs);
AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
- break;
- case ci::RequestType::ManifestDirectUpdate:
+}
+
+void HybridInstaller::ManifestDirectUpdateSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::configuration::StepParseManifest>(
ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
ci::Plugin::ActionType::Upgrade);
AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
- break;
- case ci::RequestType::ManifestPartialInstall: {
+}
+
+void HybridInstaller::ManifestPartialInstallSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::configuration::StepParseManifest>(
ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
wgt::filesystem::HybridAdditionalSharedDirs);
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
- break;
- }
- case ci::RequestType::ManifestPartialUpdate: {
+}
+
+void HybridInstaller::ManifestPartialUpdateSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::configuration::StepParseManifest>(
ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
AddStep<ci::pkgmgr::StepRunParserPlugin>(
ci::Plugin::ActionType::Upgrade);
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
- break;
- }
- case ci::RequestType::PartialUninstall: {
+}
+
+void HybridInstaller::PartialUninstallSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::pkgmgr::StepCheckRestriction>();
AddStep<ci::pkgmgr::StepCheckRemovable>();
AddStep<ci::pkgmgr::StepUnregisterApplication>();
AddStep<wgt::encryption::StepRemoveEncryptionData>();
AddStep<ci::security::StepRevokeSecurity>();
- break;
- }
- case ci::RequestType::EnablePkg:
+}
+
+void HybridInstaller::EnablePkgSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::configuration::StepParseManifest>(
ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Enable);
AddStep<ci::pkgmgr::StepRunParserPlugin>(
ci::Plugin::ActionType::Uninstall);
- break;
- case ci::RequestType::DisablePkg:
+}
+
+void HybridInstaller::DisablePkgSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::configuration::StepParseManifest>(
ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Disable);
AddStep<ci::pkgmgr::StepRunParserPlugin>(
ci::Plugin::ActionType::Uninstall);
- break;
- case ci::RequestType::MigrateExtImg: {
+}
+
+void HybridInstaller::MigrateExtImgSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::security::StepMigrateLegacyExtImage>();
AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
- break;
- }
- default:
- AddStep<ci::configuration::StepFail>();
- break;
- }
}
} // namespace hybrid
WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
: AppInstaller("wgt", pkgrmgr) {
context_->backend_data.set(new WgtBackendData());
-
- /* treat the request */
- switch (pkgmgr_->GetRequestType()) {
- case ci::RequestType::Install : {
- InstallSteps();
- break;
- }
- case ci::RequestType::Update: {
- UpdateSteps();
- break;
- }
- case ci::RequestType::Uninstall: {
- UninstallSteps();
- break;
- }
- case ci::RequestType::Reinstall: {
- ReinstallSteps();
- break;
- }
- case ci::RequestType::Delta: {
- DeltaSteps();
- break;
- }
- case ci::RequestType::Recovery: {
- RecoverySteps();
- break;
- }
- case ci::RequestType::MountInstall: {
- MountInstallSteps();
- break;
- }
- case ci::RequestType::MountUpdate: {
- MountUpdateSteps();
- break;
- }
- case ci::RequestType::ManifestDirectInstall: {
- ManifestDirectInstallSteps();
- break;
- }
- case ci::RequestType::ManifestDirectUpdate: {
- ManifestDirectUpdateSteps();
- break;
- }
- case ci::RequestType::ReadonlyUpdateInstall: {
- ReadonlyUpdateInstallSteps();
- break;
- }
- case ci::RequestType::ReadonlyUpdateUninstall: {
- ReadonlyUpdateUninstallSteps();
- break;
- }
- case ci::RequestType::ManifestPartialInstall: {
- ManifestPartialInstallSteps();
- break;
- }
- case ci::RequestType::ManifestPartialUpdate: {
- ManifestPartialUpdateSteps();
- break;
- }
- case ci::RequestType::PartialUninstall: {
- ManifestPartialUninstallSteps();
- break;
- }
- case ci::RequestType::Move: {
- MoveSteps();
- break;
- }
- case ci::RequestType::EnablePkg: {
- EnablePkgSteps();
- break;
- }
- case ci::RequestType::DisablePkg: {
- DisablePkgSteps();
- break;
- }
- case ci::RequestType::MigrateExtImg: {
- MigrateExtImgSteps();
- break;
- }
- default: {
- DefaultSteps();
- }
- }
}
void WgtInstaller::InstallSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
}
- void WgtInstaller::ManifestPartialUninstallSteps() {
+ void WgtInstaller::PartialUninstallSteps() {
AddStep<ci::configuration::StepConfigure>(pkgmgr_);
AddStep<ci::pkgmgr::StepCheckRestriction>();
AddStep<ci::pkgmgr::StepCheckRemovable>();
AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
}
- void WgtInstaller::DefaultSteps() {
- AddStep<ci::configuration::StepFail>();
- }
-
} // namespace wgt
explicit WgtInstaller(common_installer::PkgMgrPtr pkgrmgr);
private:
- void InstallSteps();
- void UpdateSteps();
- void UninstallSteps();
- void ReinstallSteps();
- void DeltaSteps();
- void RecoverySteps();
- void MountInstallSteps();
- void MountUpdateSteps();
- void ManifestDirectInstallSteps();
- void ManifestDirectUpdateSteps();
- void ReadonlyUpdateInstallSteps();
- void ReadonlyUpdateUninstallSteps();
- void ManifestPartialInstallSteps();
- void ManifestPartialUpdateSteps();
- void ManifestPartialUninstallSteps();
- void MoveSteps();
- void EnablePkgSteps();
- void DisablePkgSteps();
- void MigrateExtImgSteps();
- void DefaultSteps();
+ void InstallSteps() override;
+ void UpdateSteps() override;
+ void UninstallSteps() override;
+ void ReinstallSteps() override;
+ void DeltaSteps() override;
+ void MoveSteps() override;
+ void RecoverySteps() override;
+ void MountInstallSteps() override;
+ void MountUpdateSteps() override;
+ void ManifestDirectInstallSteps() override;
+ void ManifestDirectUpdateSteps() override;
+ void ManifestPartialInstallSteps() override;
+ void ManifestPartialUpdateSteps() override;
+ void PartialUninstallSteps() override;
+ void ReadonlyUpdateInstallSteps() override;
+ void ReadonlyUpdateUninstallSteps() override;
+ void DisablePkgSteps() override;
+ void EnablePkgSteps() override;
+ void MigrateExtImgSteps() override;
};
} // namespace wgt