1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
5 #include "wgt/wgt_installer.h"
7 #include <common/pkgmgr_interface.h>
9 #include <common/privileges.h>
10 #include <common/step/backup/step_backup_icons.h>
11 #include <common/step/backup/step_backup_manifest.h>
12 #include <common/step/backup/step_copy_backup.h>
13 #include <common/step/configuration/step_block_cross_update.h>
14 #include <common/step/configuration/step_check_install_location.h>
15 #include <common/step/configuration/step_check_tizen_version.h>
16 #include <common/step/configuration/step_configure.h>
17 #include <common/step/configuration/step_fail.h>
18 #include <common/step/configuration/step_parse_manifest.h>
19 #include <common/step/configuration/step_parse_preload.h>
20 #include <common/step/configuration/step_switch_readonly_mode.h>
21 #include <common/step/filesystem/step_acquire_external_storage.h>
22 #include <common/step/filesystem/step_optional_acquire_external_storage.h>
23 #include <common/step/filesystem/step_change_ownership_and_permission.h>
24 #include <common/step/filesystem/step_copy.h>
25 #include <common/step/filesystem/step_copy_storage_directories.h>
26 #include <common/step/filesystem/step_copy_tep.h>
27 #include <common/step/filesystem/step_create_icons.h>
28 #include <common/step/filesystem/step_create_globalapp_symlinks.h>
29 #include <common/step/filesystem/step_create_per_user_storage_directories.h>
30 #include <common/step/filesystem/step_create_storage_directories.h>
31 #include <common/step/filesystem/step_delta_patch.h>
32 #include <common/step/filesystem/step_disable_external_mount.h>
33 #include <common/step/filesystem/step_enable_external_mount.h>
34 #include <common/step/filesystem/step_migrate_legacy_external_image.h>
35 #include <common/step/filesystem/step_move_installed_storage.h>
36 #include <common/step/filesystem/step_recover_change_owner.h>
37 #include <common/step/filesystem/step_recover_files.h>
38 #include <common/step/filesystem/step_recover_icons.h>
39 #include <common/step/filesystem/step_recover_manifest.h>
40 #include <common/step/filesystem/step_recover_external_storage.h>
41 #include <common/step/filesystem/step_recover_storage_directories.h>
42 #include <common/step/filesystem/step_recover_per_user_storage_directories.h>
43 #include <common/step/filesystem/step_remove_files.h>
44 #include <common/step/filesystem/step_remove_icons.h>
45 #include <common/step/filesystem/step_remove_globalapp_symlinks.h>
46 #include <common/step/filesystem/step_remove_per_user_storage_directories.h>
47 #include <common/step/filesystem/step_remove_temporary_directory.h>
48 #include <common/step/filesystem/step_remove_tep.h>
49 #include <common/step/filesystem/step_remove_zip_image.h>
50 #include <common/step/filesystem/step_unzip.h>
51 #include <common/step/filesystem/step_update_tep.h>
52 #include <common/step/mount/step_mount_install.h>
53 #include <common/step/mount/step_mount_recover.h>
54 #include <common/step/mount/step_mount_unpacked.h>
55 #include <common/step/mount/step_mount_update.h>
56 #include <common/step/pkgmgr/step_check_force_clean.h>
57 #include <common/step/pkgmgr/step_check_installable.h>
58 #include <common/step/pkgmgr/step_check_removable.h>
59 #include <common/step/pkgmgr/step_check_restriction.h>
60 #include <common/step/pkgmgr/step_kill_apps.h>
61 #include <common/step/pkgmgr/step_recover_application.h>
62 #include <common/step/pkgmgr/step_register_app.h>
63 #include <common/step/pkgmgr/step_remove_manifest.h>
64 #include <common/step/pkgmgr/step_run_parser_plugins.h>
65 #include <common/step/pkgmgr/step_unregister_app.h>
66 #include <common/step/pkgmgr/step_update_app.h>
67 #include <common/step/pkgmgr/step_update_pkg_disable_info.h>
68 #include <common/step/rds/step_rds_modify.h>
69 #include <common/step/rds/step_rds_parse.h>
70 #include <common/step/recovery/step_open_recovery_file.h>
71 #include <common/step/security/step_check_old_certificate.h>
72 #include <common/step/security/step_check_signature.h>
73 #include <common/step/security/step_privacy_privilege.h>
74 #include <common/step/security/step_privilege_compatibility.h>
75 #include <common/step/security/step_recover_security.h>
76 #include <common/step/security/step_register_security.h>
77 #include <common/step/security/step_revoke_security.h>
78 #include <common/step/security/step_rollback_deinstallation_security.h>
79 #include <common/step/security/step_rollback_installation_security.h>
80 #include <common/step/security/step_update_security.h>
81 #include <common/step/security/step_register_trust_anchor.h>
82 #include <common/step/security/step_unregister_trust_anchor.h>
84 #include <wgt_manifest_handlers/widget_config_parser.h>
86 #include "wgt/shared_dirs.h"
87 #include "wgt/step/configuration/step_check_rds_manifest.h"
88 #include "wgt/step/configuration/step_check_start_files.h"
89 #include "wgt/step/configuration/step_parse.h"
90 #include "wgt/step/configuration/step_set_old_signature_files_location.h"
91 #include "wgt/step/encryption/step_encrypt_resources.h"
92 #include "wgt/step/encryption/step_remove_encryption_data.h"
93 #include "wgt/step/filesystem/step_copy_preview_icons.h"
94 #include "wgt/step/filesystem/step_create_symbolic_link.h"
95 #include "wgt/step/filesystem/step_wgt_patch_icons.h"
96 #include "wgt/step/filesystem/step_wgt_patch_storage_directories.h"
97 #include "wgt/step/filesystem/step_wgt_prepare_package_directory.h"
98 #include "wgt/step/filesystem/step_wgt_resource_directory.h"
99 #include "wgt/step/filesystem/step_wgt_undo_patch_storage_directories.h"
100 #include "wgt/step/filesystem/step_wgt_update_package_directory.h"
101 #include "wgt/step/pkgmgr/step_generate_xml.h"
102 #include "wgt/step/security/step_add_default_privileges.h"
103 #include "wgt/step/security/step_check_settings_level.h"
104 #include "wgt/step/security/step_check_wgt_background_category.h"
105 #include "wgt/step/security/step_check_wgt_notification_category.h"
106 #include "wgt/step/security/step_check_wgt_ime_privilege.h"
107 #include "wgt/step/security/step_direct_manifest_check_signature.h"
108 #include "wgt/step/security/step_check_extension_privileges.h"
109 #include "wgt/step/security/step_wgt_recover_signature.h"
111 namespace ci = common_installer;
115 WgtInstaller::WgtInstaller(ci::PkgMgrPtr pkgrmgr)
116 : AppInstaller("wgt", pkgrmgr) {
117 context_->backend_data.set(new WgtBackendData());
119 /* treat the request */
120 switch (pkgmgr_->GetRequestType()) {
121 case ci::RequestType::Install : {
125 case ci::RequestType::Update: {
129 case ci::RequestType::Uninstall: {
133 case ci::RequestType::Reinstall: {
137 case ci::RequestType::Delta: {
141 case ci::RequestType::Recovery: {
145 case ci::RequestType::MountInstall: {
149 case ci::RequestType::MountUpdate: {
153 case ci::RequestType::ManifestDirectInstall: {
154 ManifestDirectInstallSteps();
157 case ci::RequestType::ManifestDirectUpdate: {
158 ManifestDirectUpdateSteps();
161 case ci::RequestType::ReadonlyUpdateInstall: {
162 ReadonlyUpdateInstallSteps();
165 case ci::RequestType::ReadonlyUpdateUninstall: {
166 ReadonlyUpdateUninstallSteps();
169 case ci::RequestType::ManifestPartialInstall: {
170 ManifestPartialInstallSteps();
173 case ci::RequestType::ManifestPartialUpdate: {
174 ManifestPartialUpdateSteps();
177 case ci::RequestType::PartialUninstall: {
178 ManifestPartialUninstallSteps();
181 case ci::RequestType::Move: {
185 case ci::RequestType::EnablePkg: {
189 case ci::RequestType::DisablePkg: {
193 case ci::RequestType::MigrateExtImg: {
194 MigrateExtImgSteps();
202 void WgtInstaller::InstallSteps() {
203 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
204 AddStep<ci::filesystem::StepUnzip>();
205 AddStep<wgt::configuration::StepParse>(
206 wgt::configuration::StepParse::ConfigLocation::PACKAGE, true);
207 AddStep<ci::configuration::StepCheckInstallLocation>();
208 AddStep<ci::pkgmgr::StepCheckInstallable>();
209 AddStep<ci::configuration::StepParsePreload>();
210 AddStep<ci::pkgmgr::StepCheckRestriction>();
211 AddStep<ci::configuration::StepCheckTizenVersion>();
212 AddStep<ci::security::StepCheckSignature>();
213 AddStep<ci::security::StepPrivilegeCompatibility>(
214 ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
215 AddStep<wgt::security::StepCheckSettingsLevel>();
216 AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
217 AddStep<wgt::security::StepCheckWgtNotificationCategory>();
218 AddStep<wgt::security::StepCheckWgtImePrivilege>();
219 AddStep<wgt::encryption::StepEncryptResources>();
220 AddStep<wgt::filesystem::StepWgtResourceDirectory>();
221 AddStep<ci::security::StepRollbackInstallationSecurity>();
222 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
223 AddStep<ci::filesystem::StepAcquireExternalStorage>(false);
224 AddStep<ci::filesystem::StepCopy>();
225 AddStep<ci::filesystem::StepCopyTep>();
226 AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
227 AddStep<ci::filesystem::StepCreateStorageDirectories>();
228 AddStep<wgt::filesystem::StepCreateSymbolicLink>();
229 AddStep<wgt::filesystem::StepWgtPatchIcons>();
230 AddStep<ci::filesystem::StepCreateIcons>();
231 AddStep<wgt::filesystem::StepCopyPreviewIcons>();
232 AddStep<wgt::security::StepCheckExtensionPrivileges>();
233 AddStep<wgt::pkgmgr::StepGenerateXml>();
234 AddStep<ci::pkgmgr::StepRegisterApplication>();
235 AddStep<ci::security::StepRegisterTrustAnchor>(
236 ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
237 AddStep<ci::security::StepPrivacyPrivilege>(
238 ci::security::StepPrivacyPrivilege::ActionType::Install);
239 AddStep<ci::security::StepRegisterSecurity>();
240 AddStep<ci::pkgmgr::StepRunParserPlugin>(
241 ci::Plugin::ActionType::Install);
242 AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
243 wgt::filesystem::WgtAdditionalSharedDirs);
244 AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
245 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
248 void WgtInstaller::UpdateSteps() {
249 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
250 AddStep<ci::filesystem::StepUnzip>();
251 AddStep<wgt::configuration::StepParse>(
252 wgt::configuration::StepParse::ConfigLocation::PACKAGE, true);
253 AddStep<ci::configuration::StepCheckInstallLocation>();
254 AddStep<ci::configuration::StepParsePreload>();
255 AddStep<ci::configuration::StepCheckTizenVersion>();
256 AddStep<ci::security::StepCheckSignature>();
257 AddStep<ci::security::StepPrivilegeCompatibility>(
258 ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
259 AddStep<wgt::security::StepCheckSettingsLevel>();
260 AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
261 AddStep<wgt::security::StepCheckWgtNotificationCategory>();
262 AddStep<wgt::security::StepCheckWgtImePrivilege>();
263 AddStep<ci::security::StepCheckOldCertificate>();
264 AddStep<wgt::encryption::StepEncryptResources>();
265 AddStep<wgt::filesystem::StepWgtResourceDirectory>();
266 AddStep<ci::configuration::StepParseManifest>(
267 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
268 ci::configuration::StepParseManifest::StoreLocation::BACKUP);
269 AddStep<ci::configuration::StepBlockCrossUpdate>();
270 AddStep<ci::pkgmgr::StepKillApps>();
271 AddStep<ci::backup::StepBackupManifest>();
272 AddStep<ci::backup::StepBackupIcons>();
273 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
274 AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
275 AddStep<ci::backup::StepCopyBackup>();
276 AddStep<ci::filesystem::StepUpdateTep>();
277 AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
278 AddStep<wgt::filesystem::StepCreateSymbolicLink>();
279 AddStep<wgt::filesystem::StepWgtPatchIcons>();
280 AddStep<ci::filesystem::StepCreateIcons>();
281 AddStep<wgt::filesystem::StepCopyPreviewIcons>();
282 AddStep<ci::filesystem::StepCopyStorageDirectories>();
283 AddStep<wgt::security::StepCheckExtensionPrivileges>();
284 AddStep<wgt::pkgmgr::StepGenerateXml>();
285 AddStep<ci::pkgmgr::StepUpdateApplication>();
286 AddStep<ci::security::StepRegisterTrustAnchor>(
287 ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
288 AddStep<ci::security::StepPrivacyPrivilege>(
289 ci::security::StepPrivacyPrivilege::ActionType::Update);
290 AddStep<ci::security::StepUpdateSecurity>();
291 AddStep<ci::pkgmgr::StepRunParserPlugin>(
292 ci::Plugin::ActionType::Upgrade);
293 AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
294 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
297 void WgtInstaller::UninstallSteps() {
298 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
299 AddStep<ci::pkgmgr::StepCheckRestriction>();
300 AddStep<ci::pkgmgr::StepCheckRemovable>();
301 AddStep<ci::pkgmgr::StepCheckForceClean>();
302 AddStep<ci::configuration::StepParseManifest>(
303 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
304 ci::configuration::StepParseManifest::StoreLocation::NORMAL);
305 AddStep<ci::configuration::StepCheckInstallLocation>();
306 AddStep<ci::pkgmgr::StepKillApps>();
307 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
308 AddStep<ci::filesystem::StepOptionalAcquireExternalStorage>();
309 AddStep<ci::pkgmgr::StepRunParserPlugin>(
310 ci::Plugin::ActionType::Uninstall);
311 AddStep<ci::filesystem::StepRemovePerUserStorageDirectories>();
312 AddStep<ci::pkgmgr::StepUnregisterApplication>();
313 AddStep<ci::security::StepRollbackDeinstallationSecurity>();
314 AddStep<ci::filesystem::StepRemoveTep>();
315 AddStep<ci::filesystem::StepRemoveFiles>();
316 AddStep<ci::filesystem::StepRemoveZipImage>();
317 AddStep<ci::filesystem::StepRemoveIcons>();
318 AddStep<wgt::encryption::StepRemoveEncryptionData>();
319 AddStep<ci::security::StepUnregisterTrustAnchor>();
320 AddStep<ci::security::StepPrivacyPrivilege>(
321 ci::security::StepPrivacyPrivilege::ActionType::Uninstall);
322 AddStep<ci::security::StepRevokeSecurity>();
323 AddStep<ci::pkgmgr::StepRemoveManifest>();
324 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
327 void WgtInstaller::ReinstallSteps() {
328 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
329 AddStep<wgt::configuration::StepCheckRDSManifest>();
330 AddStep<wgt::configuration::StepParse>(
331 wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, false);
332 AddStep<ci::configuration::StepCheckInstallLocation>();
333 AddStep<ci::configuration::StepParsePreload>();
334 AddStep<ci::pkgmgr::StepCheckRestriction>();
335 AddStep<ci::configuration::StepCheckTizenVersion>();
336 AddStep<ci::pkgmgr::StepKillApps>();
337 AddStep<ci::configuration::StepParseManifest>(
338 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
339 ci::configuration::StepParseManifest::StoreLocation::BACKUP);
340 AddStep<ci::configuration::StepBlockCrossUpdate>();
341 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
342 AddStep<ci::rds::StepRDSParse>();
343 AddStep<ci::filesystem::StepUpdateTep>();
344 AddStep<ci::rds::StepRDSModify>();
345 AddStep<wgt::security::StepCheckExtensionPrivileges>();
346 AddStep<ci::security::StepRegisterTrustAnchor>(
347 ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
348 AddStep<ci::security::StepPrivacyPrivilege>(
349 ci::security::StepPrivacyPrivilege::ActionType::Update);
350 AddStep<ci::security::StepUpdateSecurity>();
351 AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
352 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
355 void WgtInstaller::DeltaSteps() {
356 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
357 AddStep<ci::filesystem::StepUnzip>();
358 AddStep<wgt::configuration::StepParse>(
359 wgt::configuration::StepParse::ConfigLocation::PACKAGE, false);
360 AddStep<ci::configuration::StepCheckInstallLocation>();
361 AddStep<ci::configuration::StepParseManifest>(
362 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
363 ci::configuration::StepParseManifest::StoreLocation::BACKUP);
364 AddStep<ci::configuration::StepParsePreload>();
365 AddStep<ci::configuration::StepCheckTizenVersion>();
366 AddStep<ci::filesystem::StepEnableExternalMount>();
367 AddStep<wgt::filesystem::StepWgtUndoPatchStorageDirectories>();
368 AddStep<ci::filesystem::StepDeltaPatch>("res/wgt/");
369 AddStep<ci::filesystem::StepDisableExternalMount>();
370 AddStep<wgt::configuration::StepCheckStartFiles>();
371 AddStep<ci::security::StepCheckSignature>();
372 AddStep<ci::security::StepPrivilegeCompatibility>(
373 ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
374 AddStep<wgt::security::StepCheckSettingsLevel>();
375 AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
376 AddStep<wgt::security::StepCheckWgtNotificationCategory>();
377 AddStep<wgt::security::StepCheckWgtImePrivilege>();
378 AddStep<ci::security::StepCheckOldCertificate>();
379 AddStep<wgt::encryption::StepEncryptResources>();
380 AddStep<wgt::filesystem::StepWgtResourceDirectory>();
381 AddStep<ci::configuration::StepBlockCrossUpdate>();
382 AddStep<ci::pkgmgr::StepKillApps>();
383 AddStep<ci::backup::StepBackupManifest>();
384 AddStep<ci::backup::StepBackupIcons>();
385 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
386 AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
387 AddStep<ci::backup::StepCopyBackup>();
388 AddStep<ci::filesystem::StepUpdateTep>();
389 AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
390 AddStep<wgt::filesystem::StepCreateSymbolicLink>();
391 AddStep<wgt::filesystem::StepWgtPatchIcons>();
392 AddStep<ci::filesystem::StepCreateIcons>();
393 AddStep<wgt::filesystem::StepCopyPreviewIcons>();
394 AddStep<ci::filesystem::StepCopyStorageDirectories>();
395 AddStep<wgt::security::StepCheckExtensionPrivileges>();
396 AddStep<wgt::pkgmgr::StepGenerateXml>();
397 AddStep<ci::pkgmgr::StepUpdateApplication>();
398 AddStep<ci::security::StepRegisterTrustAnchor>(
399 ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
400 AddStep<ci::security::StepPrivacyPrivilege>(
401 ci::security::StepPrivacyPrivilege::ActionType::Update);
402 AddStep<ci::security::StepUpdateSecurity>();
403 AddStep<ci::pkgmgr::StepRunParserPlugin>(
404 ci::Plugin::ActionType::Upgrade);
405 AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
406 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
409 void WgtInstaller::RecoverySteps() {
410 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
411 AddStep<ci::recovery::StepOpenRecoveryFile>();
412 AddStep<ci::filesystem::StepRemoveTemporaryDirectory>();
413 AddStep<ci::configuration::StepParseManifest>(
414 ci::configuration::StepParseManifest::ManifestLocation::RECOVERY,
415 ci::configuration::StepParseManifest::StoreLocation::NORMAL);
416 AddStep<ci::filesystem::StepRecoverIcons>();
417 AddStep<ci::filesystem::StepRecoverManifest>();
418 AddStep<ci::filesystem::StepRecoverExternalStorage>();
419 AddStep<ci::filesystem::StepRecoverStorageDirectories>();
420 AddStep<ci::filesystem::StepRecoverPerUserStorageDirectories>();
421 AddStep<ci::filesystem::StepRecoverFiles>();
422 AddStep<ci::mount::StepMountRecover>();
423 AddStep<wgt::security::StepWgtRecoverSignature>();
424 AddStep<ci::filesystem::StepRecoverChangeOwner>();
425 AddStep<ci::security::StepRecoverSecurity>();
426 AddStep<ci::pkgmgr::StepRecoverApplication>();
429 void WgtInstaller::MountInstallSteps() {
430 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
431 AddStep<ci::mount::StepMountUnpacked>();
432 AddStep<wgt::configuration::StepParse>(
433 wgt::configuration::StepParse::ConfigLocation::PACKAGE, true);
434 AddStep<ci::configuration::StepCheckInstallLocation>();
435 AddStep<ci::pkgmgr::StepCheckInstallable>();
436 AddStep<ci::configuration::StepParsePreload>();
437 AddStep<ci::pkgmgr::StepCheckRestriction>();
438 AddStep<ci::configuration::StepCheckTizenVersion>();
439 AddStep<ci::security::StepCheckSignature>();
440 AddStep<ci::security::StepPrivilegeCompatibility>(
441 ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
442 AddStep<wgt::security::StepCheckSettingsLevel>();
443 AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
444 AddStep<wgt::security::StepCheckWgtNotificationCategory>();
445 AddStep<wgt::security::StepCheckWgtImePrivilege>();
446 AddStep<wgt::encryption::StepEncryptResources>();
447 AddStep<ci::security::StepRollbackInstallationSecurity>();
448 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
449 AddStep<ci::mount::StepMountInstall>();
450 AddStep<wgt::filesystem::StepWgtPreparePackageDirectory>();
451 AddStep<ci::filesystem::StepCopyTep>();
452 AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
453 AddStep<ci::filesystem::StepCreateStorageDirectories>();
454 AddStep<wgt::filesystem::StepCreateSymbolicLink>();
455 AddStep<wgt::filesystem::StepWgtPatchIcons>();
456 AddStep<ci::filesystem::StepCreateIcons>();
457 AddStep<wgt::filesystem::StepCopyPreviewIcons>();
458 AddStep<wgt::pkgmgr::StepGenerateXml>();
459 AddStep<wgt::security::StepCheckExtensionPrivileges>();
460 AddStep<ci::pkgmgr::StepRegisterApplication>();
461 AddStep<ci::security::StepRegisterTrustAnchor>(
462 ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
463 AddStep<ci::security::StepPrivacyPrivilege>(
464 ci::security::StepPrivacyPrivilege::ActionType::Install);
465 AddStep<ci::security::StepRegisterSecurity>();
466 AddStep<ci::pkgmgr::StepRunParserPlugin>(
467 ci::Plugin::ActionType::Install);
468 AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
469 wgt::filesystem::WgtAdditionalSharedDirs);
470 AddStep<ci::filesystem::StepChangeOwnershipAndPermission>(true);
471 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
474 void WgtInstaller::MountUpdateSteps() {
475 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
476 AddStep<ci::mount::StepMountUnpacked>();
477 AddStep<wgt::configuration::StepParse>(
478 wgt::configuration::StepParse::ConfigLocation::PACKAGE, true);
479 AddStep<ci::configuration::StepCheckInstallLocation>();
480 AddStep<ci::configuration::StepParsePreload>();
481 AddStep<ci::configuration::StepCheckTizenVersion>();
482 AddStep<ci::security::StepCheckSignature>();
483 AddStep<ci::security::StepPrivilegeCompatibility>(
484 ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
485 AddStep<wgt::security::StepCheckSettingsLevel>();
486 AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
487 AddStep<wgt::security::StepCheckWgtNotificationCategory>();
488 AddStep<wgt::security::StepCheckWgtImePrivilege>();
489 AddStep<ci::security::StepCheckOldCertificate>();
490 AddStep<ci::configuration::StepParseManifest>(
491 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
492 ci::configuration::StepParseManifest::StoreLocation::BACKUP);
493 AddStep<ci::configuration::StepBlockCrossUpdate>();
494 AddStep<ci::pkgmgr::StepKillApps>();
495 AddStep<ci::backup::StepBackupManifest>();
496 AddStep<ci::backup::StepBackupIcons>();
497 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
498 AddStep<ci::mount::StepMountUpdate>();
499 AddStep<wgt::filesystem::StepWgtUpdatePackageDirectory>();
500 AddStep<ci::filesystem::StepUpdateTep>();
501 AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
502 AddStep<wgt::filesystem::StepCreateSymbolicLink>();
503 AddStep<wgt::filesystem::StepWgtPatchIcons>();
504 AddStep<ci::filesystem::StepCreateIcons>();
505 AddStep<wgt::filesystem::StepCopyPreviewIcons>();
506 AddStep<wgt::security::StepCheckExtensionPrivileges>();
507 AddStep<wgt::pkgmgr::StepGenerateXml>();
508 AddStep<ci::pkgmgr::StepUpdateApplication>();
509 AddStep<ci::security::StepRegisterTrustAnchor>(
510 ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
511 AddStep<ci::security::StepPrivacyPrivilege>(
512 ci::security::StepPrivacyPrivilege::ActionType::Update);
513 AddStep<ci::security::StepUpdateSecurity>();
514 AddStep<ci::pkgmgr::StepRunParserPlugin>(
515 ci::Plugin::ActionType::Upgrade);
516 AddStep<ci::filesystem::StepChangeOwnershipAndPermission>(true);
517 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
520 void WgtInstaller::ManifestDirectInstallSteps() {
521 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
522 AddStep<wgt::configuration::StepParse>(
523 wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
524 AddStep<ci::pkgmgr::StepCheckInstallable>();
525 AddStep<ci::configuration::StepParsePreload>();
526 AddStep<ci::configuration::StepCheckTizenVersion>();
527 AddStep<wgt::security::StepDirectManifestCheckSignature>();
528 AddStep<ci::security::StepPrivilegeCompatibility>(
529 ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
530 AddStep<wgt::security::StepCheckWgtNotificationCategory>();
531 AddStep<wgt::security::StepCheckWgtImePrivilege>();
532 AddStep<wgt::security::StepCheckSettingsLevel>();
533 AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
534 AddStep<ci::security::StepRollbackInstallationSecurity>();
535 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
536 AddStep<wgt::filesystem::StepWgtPatchIcons>();
537 AddStep<wgt::pkgmgr::StepGenerateXml>();
538 AddStep<ci::pkgmgr::StepRegisterApplication>();
539 AddStep<ci::security::StepRegisterTrustAnchor>(
540 ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
541 AddStep<ci::security::StepPrivacyPrivilege>(
542 ci::security::StepPrivacyPrivilege::ActionType::Install);
543 AddStep<ci::security::StepRegisterSecurity>();
544 AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Install);
545 AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
546 wgt::filesystem::WgtAdditionalSharedDirs);
547 AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
548 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
551 void WgtInstaller::ManifestDirectUpdateSteps() {
552 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
553 AddStep<wgt::configuration::StepParse>(
554 wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
555 AddStep<ci::configuration::StepParsePreload>();
556 AddStep<ci::configuration::StepCheckTizenVersion>();
557 AddStep<wgt::security::StepDirectManifestCheckSignature>();
558 AddStep<ci::security::StepPrivilegeCompatibility>(
559 ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
560 AddStep<wgt::security::StepCheckWgtNotificationCategory>();
561 AddStep<wgt::security::StepCheckWgtImePrivilege>();
562 AddStep<wgt::security::StepCheckSettingsLevel>();
563 AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
564 AddStep<ci::configuration::StepParseManifest>(
565 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
566 ci::configuration::StepParseManifest::StoreLocation::BACKUP);
567 AddStep<ci::pkgmgr::StepKillApps>();
568 AddStep<ci::filesystem::StepCopyTep>();
569 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
570 AddStep<wgt::filesystem::StepWgtPatchIcons>();
571 AddStep<wgt::pkgmgr::StepGenerateXml>();
572 AddStep<ci::pkgmgr::StepUpdateApplication>();
573 AddStep<ci::security::StepRegisterTrustAnchor>(
574 ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
575 AddStep<ci::security::StepPrivacyPrivilege>(
576 ci::security::StepPrivacyPrivilege::ActionType::Update);
577 AddStep<ci::security::StepUpdateSecurity>();
578 AddStep<ci::pkgmgr::StepRunParserPlugin>(
579 ci::Plugin::ActionType::Upgrade);
580 AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
581 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
584 void WgtInstaller::ReadonlyUpdateInstallSteps() {
585 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
586 AddStep<ci::filesystem::StepUnzip>();
587 AddStep<wgt::configuration::StepParse>(
588 wgt::configuration::StepParse::ConfigLocation::PACKAGE, true);
589 AddStep<ci::configuration::StepParsePreload>();
590 AddStep<ci::configuration::StepCheckTizenVersion>();
591 AddStep<ci::security::StepCheckSignature>();
592 AddStep<ci::security::StepPrivilegeCompatibility>(
593 ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
594 AddStep<wgt::security::StepCheckSettingsLevel>();
595 AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
596 AddStep<wgt::security::StepCheckWgtNotificationCategory>();
597 AddStep<wgt::security::StepCheckWgtImePrivilege>();
598 AddStep<ci::security::StepCheckOldCertificate>();
599 AddStep<wgt::encryption::StepEncryptResources>();
600 AddStep<wgt::filesystem::StepWgtResourceDirectory>();
601 AddStep<ci::security::StepRollbackInstallationSecurity>();
602 AddStep<ci::configuration::StepSwitchReadonlyMode>();
603 AddStep<ci::configuration::StepParseManifest>(
604 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
605 ci::configuration::StepParseManifest::StoreLocation::BACKUP);
606 AddStep<ci::configuration::StepSwitchReadonlyMode>();
607 AddStep<ci::configuration::StepBlockCrossUpdate>();
608 AddStep<ci::pkgmgr::StepKillApps>();
609 AddStep<ci::filesystem::StepCopy>();
610 AddStep<ci::filesystem::StepCopyTep>();
611 AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
612 AddStep<ci::filesystem::StepCreateStorageDirectories>();
613 AddStep<wgt::filesystem::StepCreateSymbolicLink>();
614 AddStep<wgt::filesystem::StepWgtPatchIcons>();
615 AddStep<wgt::filesystem::StepCopyPreviewIcons>();
616 AddStep<wgt::security::StepCheckExtensionPrivileges>();
617 AddStep<wgt::pkgmgr::StepGenerateXml>();
618 AddStep<ci::pkgmgr::StepUpdateApplication>();
619 AddStep<ci::security::StepRegisterTrustAnchor>(
620 ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
621 AddStep<ci::security::StepPrivacyPrivilege>(
622 ci::security::StepPrivacyPrivilege::ActionType::Update);
623 AddStep<ci::security::StepUpdateSecurity>();
624 AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
625 AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
626 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
629 void WgtInstaller::ReadonlyUpdateUninstallSteps() {
630 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
631 AddStep<ci::pkgmgr::StepCheckRestriction>();
632 AddStep<ci::pkgmgr::StepCheckRemovable>();
633 AddStep<ci::configuration::StepParseManifest>(
634 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
635 ci::configuration::StepParseManifest::StoreLocation::BACKUP);
636 AddStep<ci::configuration::StepSwitchReadonlyMode>();
637 AddStep<ci::configuration::StepParseManifest>(
638 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
639 ci::configuration::StepParseManifest::StoreLocation::NORMAL);
640 AddStep<ci::configuration::StepParsePreload>();
641 AddStep<wgt::configuration::StepSetOldSignatureFilesLocation>();
642 AddStep<ci::security::StepCheckSignature>();
643 AddStep<ci::configuration::StepSwitchReadonlyMode>();
644 AddStep<ci::pkgmgr::StepKillApps>();
645 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
646 AddStep<ci::filesystem::StepRemoveTep>();
647 AddStep<ci::filesystem::StepRemoveFiles>();
648 AddStep<ci::filesystem::StepRemoveZipImage>();
649 AddStep<ci::pkgmgr::StepUpdateApplication>();
650 AddStep<ci::configuration::StepSwitchReadonlyMode>();
651 AddStep<ci::security::StepRegisterTrustAnchor>(
652 ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
653 AddStep<ci::security::StepPrivacyPrivilege>(
654 ci::security::StepPrivacyPrivilege::ActionType::Update);
655 AddStep<ci::security::StepUpdateSecurity>();
656 AddStep<ci::pkgmgr::StepRemoveManifest>();
657 AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Upgrade);
660 void WgtInstaller::ManifestPartialInstallSteps() {
661 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
662 AddStep<wgt::configuration::StepParse>(
663 wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
664 AddStep<ci::configuration::StepParsePreload>();
665 AddStep<ci::security::StepCheckSignature>();
666 AddStep<ci::security::StepPrivilegeCompatibility>(
667 ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
668 AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
669 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
670 AddStep<ci::pkgmgr::StepRegisterApplication>();
671 AddStep<ci::security::StepRegisterTrustAnchor>(
672 ci::security::StepRegisterTrustAnchor::RegisterType::INSTALL);
673 AddStep<ci::security::StepPrivacyPrivilege>(
674 ci::security::StepPrivacyPrivilege::ActionType::Install);
675 AddStep<ci::security::StepRegisterSecurity>();
676 AddStep<ci::pkgmgr::StepRunParserPlugin>(ci::Plugin::ActionType::Install);
677 AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>(
678 wgt::filesystem::WgtAdditionalSharedDirs);
679 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
682 void WgtInstaller::ManifestPartialUpdateSteps() {
683 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
684 AddStep<wgt::configuration::StepParse>(
685 wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
686 AddStep<ci::configuration::StepParsePreload>();
687 AddStep<ci::configuration::StepParseManifest>(
688 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
689 ci::configuration::StepParseManifest::StoreLocation::BACKUP);
690 AddStep<ci::security::StepCheckSignature>();
691 AddStep<ci::security::StepPrivilegeCompatibility>(
692 ci::security::StepPrivilegeCompatibility::InternalPrivType::WGT);
693 AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
694 AddStep<ci::pkgmgr::StepKillApps>();
695 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
696 AddStep<ci::pkgmgr::StepUpdateApplication>();
697 AddStep<ci::security::StepRegisterTrustAnchor>(
698 ci::security::StepRegisterTrustAnchor::RegisterType::UPDATE);
699 AddStep<ci::security::StepPrivacyPrivilege>(
700 ci::security::StepPrivacyPrivilege::ActionType::Update);
701 AddStep<ci::security::StepUpdateSecurity>();
702 AddStep<ci::pkgmgr::StepRunParserPlugin>(
703 ci::Plugin::ActionType::Upgrade);
704 AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
707 void WgtInstaller::ManifestPartialUninstallSteps() {
708 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
709 AddStep<ci::pkgmgr::StepCheckRestriction>();
710 AddStep<ci::pkgmgr::StepCheckRemovable>();
711 AddStep<ci::pkgmgr::StepCheckForceClean>();
712 AddStep<ci::configuration::StepParseManifest>(
713 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
714 ci::configuration::StepParseManifest::StoreLocation::NORMAL);
715 AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
716 AddStep<ci::filesystem::StepOptionalAcquireExternalStorage>();
717 AddStep<ci::pkgmgr::StepRunParserPlugin>(
718 ci::Plugin::ActionType::Uninstall);
719 AddStep<ci::filesystem::StepRemovePerUserStorageDirectories>();
720 AddStep<ci::pkgmgr::StepUnregisterApplication>();
721 AddStep<wgt::encryption::StepRemoveEncryptionData>();
722 AddStep<ci::security::StepUnregisterTrustAnchor>();
723 AddStep<ci::security::StepPrivacyPrivilege>(
724 ci::security::StepPrivacyPrivilege::ActionType::Uninstall);
725 AddStep<ci::security::StepRevokeSecurity>();
728 void WgtInstaller::MoveSteps() {
729 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
730 AddStep<ci::configuration::StepParseManifest>(
731 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
732 ci::configuration::StepParseManifest::StoreLocation::NORMAL);
733 AddStep<ci::configuration::StepCheckInstallLocation>();
734 AddStep<ci::pkgmgr::StepKillApps>();
735 AddStep<ci::filesystem::StepMoveInstalledStorage>();
736 AddStep<ci::security::StepRegisterSecurity>();
739 void WgtInstaller::EnablePkgSteps() {
740 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
741 AddStep<ci::configuration::StepParseManifest>(
742 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
743 ci::configuration::StepParseManifest::StoreLocation::NORMAL);
744 AddStep<ci::pkgmgr::StepKillApps>();
745 AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
746 ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Enable);
747 AddStep<ci::pkgmgr::StepRunParserPlugin>(
748 ci::Plugin::ActionType::Uninstall);
751 void WgtInstaller::DisablePkgSteps() {
752 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
753 AddStep<ci::configuration::StepParseManifest>(
754 ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
755 ci::configuration::StepParseManifest::StoreLocation::NORMAL);
756 AddStep<ci::pkgmgr::StepKillApps>();
757 AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
758 ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Disable);
759 AddStep<ci::pkgmgr::StepRunParserPlugin>(
760 ci::Plugin::ActionType::Uninstall);
763 void WgtInstaller::MigrateExtImgSteps() {
764 AddStep<ci::configuration::StepConfigure>(pkgmgr_);
765 AddStep<ci::security::StepMigrateLegacyExtImage>();
766 AddStep<ci::filesystem::StepChangeOwnershipAndPermission>();
769 void WgtInstaller::DefaultSteps() {
770 AddStep<ci::configuration::StepFail>();