symlink control for read-only files of global app.
[platform/core/appfw/wgt-backend.git] / src / hybrid / hybrid_installer.cc
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.
4
5 #include "hybrid/hybrid_installer.h"
6
7 #include <common/step/backup/step_backup_icons.h>
8 #include <common/step/backup/step_backup_manifest.h>
9 #include <common/step/backup/step_copy_backup.h>
10 #include <common/step/configuration/step_block_cross_update.h>
11 #include <common/step/configuration/step_check_tizen_version.h>
12 #include <common/step/configuration/step_configure.h>
13 #include <common/step/configuration/step_fail.h>
14 #include <common/step/configuration/step_parse_manifest.h>
15 #include <common/step/configuration/step_parse_preload.h>
16 #include <common/step/filesystem/step_acquire_external_storage.h>
17 #include <common/step/filesystem/step_clear_data.h>
18 #include <common/step/filesystem/step_copy.h>
19 #include <common/step/filesystem/step_copy_storage_directories.h>
20 #include <common/step/filesystem/step_copy_tep.h>
21 #include <common/step/filesystem/step_create_icons.h>
22 #include <common/step/filesystem/step_create_globalapp_symlinks.h>
23 #include <common/step/filesystem/step_create_per_user_storage_directories.h>
24 #include <common/step/filesystem/step_create_storage_directories.h>
25 #include <common/step/filesystem/step_delta_patch.h>
26 #include <common/step/filesystem/step_disable_external_mount.h>
27 #include <common/step/filesystem/step_enable_external_mount.h>
28 #include <common/step/filesystem/step_recover_files.h>
29 #include <common/step/filesystem/step_recover_icons.h>
30 #include <common/step/filesystem/step_recover_manifest.h>
31 #include <common/step/filesystem/step_recover_external_storage.h>
32 #include <common/step/filesystem/step_recover_storage_directories.h>
33 #include <common/step/filesystem/step_remove_files.h>
34 #include <common/step/filesystem/step_remove_icons.h>
35 #include <common/step/filesystem/step_remove_globalapp_symlinks.h>
36 #include <common/step/filesystem/step_remove_per_user_storage_directories.h>
37 #include <common/step/filesystem/step_remove_temporary_directory.h>
38 #include <common/step/filesystem/step_remove_zip_image.h>
39 #include <common/step/filesystem/step_remove_tep.h>
40 #include <common/step/filesystem/step_unzip.h>
41 #include <common/step/filesystem/step_update_tep.h>
42 #include <common/step/mount/step_mount_install.h>
43 #include <common/step/mount/step_mount_unpacked.h>
44 #include <common/step/mount/step_mount_update.h>
45 #include <common/step/pkgmgr/step_check_removable.h>
46 #include <common/step/pkgmgr/step_check_restriction.h>
47 #include <common/step/pkgmgr/step_kill_apps.h>
48 #include <common/step/pkgmgr/step_recover_application.h>
49 #include <common/step/pkgmgr/step_register_app.h>
50 #include <common/step/pkgmgr/step_remove_manifest.h>
51 #include <common/step/pkgmgr/step_run_parser_plugins.h>
52 #include <common/step/pkgmgr/step_unregister_app.h>
53 #include <common/step/pkgmgr/step_update_app.h>
54 #include <common/step/pkgmgr/step_update_pkg_disable_info.h>
55 #include <common/step/recovery/step_open_recovery_file.h>
56 #include <common/step/security/step_check_signature.h>
57 #include <common/step/security/step_privilege_compatibility.h>
58 #include <common/step/security/step_recover_security.h>
59 #include <common/step/security/step_register_security.h>
60 #include <common/step/security/step_revoke_security.h>
61 #include <common/step/security/step_rollback_deinstallation_security.h>
62 #include <common/step/security/step_rollback_installation_security.h>
63 #include <common/step/security/step_update_security.h>
64
65 #include <tpk/step/filesystem/step_create_symbolic_link.h>
66 #include <tpk/step/filesystem/step_tpk_patch_icons.h>
67 #include <tpk/step/filesystem/step_tpk_prepare_package_directory.h>
68 #include <tpk/step/filesystem/step_tpk_update_package_directory.h>
69
70 #include "hybrid/hybrid_backend_data.h"
71 #include "hybrid/step/configuration/step_merge_tpk_config.h"
72 #include "hybrid/step/configuration/step_stash_tpk_config.h"
73 #include "hybrid/step/encryption/step_encrypt_resources.h"
74 #include "wgt/step/configuration/step_parse.h"
75 #include "wgt/step/encryption/step_remove_encryption_data.h"
76 #include "wgt/step/filesystem/step_copy_preview_icons.h"
77 #include "wgt/step/filesystem/step_create_symbolic_link.h"
78 #include "wgt/step/filesystem/step_wgt_patch_icons.h"
79 #include "wgt/step/filesystem/step_wgt_patch_storage_directories.h"
80 #include "wgt/step/pkgmgr/step_generate_xml.h"
81 #include "wgt/step/security/step_check_settings_level.h"
82 #include "wgt/step/security/step_check_wgt_background_category.h"
83 #include "wgt/step/security/step_check_wgt_notification_category.h"
84 #include "wgt/step/security/step_check_wgt_ime_privilege.h"
85
86 namespace ci = common_installer;
87
88 namespace hybrid {
89
90 HybridInstaller::HybridInstaller(common_installer::PkgMgrPtr pkgmgr)
91     : AppInstaller("wgt", pkgmgr) {
92   context_->backend_data.set(new HybridBackendData());
93
94   switch (pkgmgr_->GetRequestType()) {
95     case ci::RequestType::Install:
96       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
97       AddStep<ci::filesystem::StepUnzip>();
98       AddStep<ci::configuration::StepParseManifest>(
99           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
100           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
101       AddStep<hybrid::configuration::StepStashTpkConfig>();
102       AddStep<wgt::configuration::StepParse>(
103           wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
104       AddStep<hybrid::configuration::StepMergeTpkConfig>();
105       AddStep<ci::configuration::StepParsePreload>();
106       AddStep<ci::pkgmgr::StepCheckRestriction>();
107       AddStep<ci::configuration::StepCheckTizenVersion>();
108       AddStep<ci::security::StepCheckSignature>();
109       AddStep<ci::security::StepPrivilegeCompatibility>();
110       AddStep<wgt::security::StepCheckSettingsLevel>();
111       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
112       AddStep<wgt::security::StepCheckWgtNotificationCategory>();
113       AddStep<wgt::security::StepCheckWgtImePrivilege>();
114       AddStep<hybrid::encryption::StepEncryptResources>();
115       AddStep<ci::security::StepRollbackInstallationSecurity>();
116       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
117       AddStep<ci::filesystem::StepAcquireExternalStorage>(false);
118       AddStep<ci::filesystem::StepCopy>();
119       AddStep<ci::filesystem::StepCopyTep>();
120       AddStep<tpk::filesystem::StepTpkPatchIcons>();
121       AddStep<wgt::filesystem::StepWgtPatchIcons>();
122       AddStep<ci::filesystem::StepCreateIcons>();
123       AddStep<wgt::filesystem::StepCopyPreviewIcons>();
124       AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
125       AddStep<ci::filesystem::StepCreateStorageDirectories>();
126       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
127       AddStep<tpk::filesystem::StepCreateSymbolicLink>();
128       AddStep<wgt::pkgmgr::StepGenerateXml>();
129       AddStep<ci::pkgmgr::StepRunParserPlugin>(
130           ci::Plugin::ActionType::Install);
131       AddStep<ci::pkgmgr::StepRegisterApplication>();
132       AddStep<ci::security::StepRegisterSecurity>();
133       AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
134       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
135       break;
136     case ci::RequestType::Update:
137       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
138       AddStep<ci::filesystem::StepUnzip>();
139       AddStep<ci::configuration::StepParseManifest>(
140           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
141           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
142       AddStep<hybrid::configuration::StepStashTpkConfig>();
143       AddStep<wgt::configuration::StepParse>(
144           wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
145       AddStep<hybrid::configuration::StepMergeTpkConfig>();
146       AddStep<ci::configuration::StepParsePreload>();
147       AddStep<ci::configuration::StepCheckTizenVersion>();
148       AddStep<ci::security::StepCheckSignature>();
149       AddStep<ci::security::StepPrivilegeCompatibility>();
150       AddStep<wgt::security::StepCheckSettingsLevel>();
151       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
152       AddStep<wgt::security::StepCheckWgtNotificationCategory>();
153       AddStep<wgt::security::StepCheckWgtImePrivilege>();
154       AddStep<hybrid::encryption::StepEncryptResources>();
155       AddStep<ci::security::StepRollbackInstallationSecurity>();
156       AddStep<ci::configuration::StepParseManifest>(
157           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
158           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
159       AddStep<ci::configuration::StepBlockCrossUpdate>();
160       AddStep<ci::pkgmgr::StepKillApps>();
161       AddStep<ci::backup::StepBackupManifest>();
162       AddStep<ci::backup::StepBackupIcons>();
163       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
164       AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
165       AddStep<ci::backup::StepCopyBackup>();
166       AddStep<ci::filesystem::StepUpdateTep>();
167       AddStep<tpk::filesystem::StepTpkPatchIcons>();
168       AddStep<wgt::filesystem::StepWgtPatchIcons>();
169       AddStep<ci::filesystem::StepCreateIcons>();
170       AddStep<wgt::filesystem::StepCopyPreviewIcons>();
171       AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
172       AddStep<ci::filesystem::StepCopyStorageDirectories>();
173       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
174       AddStep<tpk::filesystem::StepCreateSymbolicLink>();
175       AddStep<ci::security::StepUpdateSecurity>();
176       AddStep<wgt::pkgmgr::StepGenerateXml>();
177       AddStep<ci::pkgmgr::StepUpdateApplication>();
178       AddStep<ci::pkgmgr::StepRunParserPlugin>(
179           ci::Plugin::ActionType::Upgrade);
180       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
181       break;
182     case ci::RequestType::Uninstall:
183       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
184       AddStep<ci::pkgmgr::StepCheckRestriction>();
185       AddStep<ci::pkgmgr::StepCheckRemovable>();
186       AddStep<ci::configuration::StepParseManifest>(
187           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
188           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
189       AddStep<ci::pkgmgr::StepRunParserPlugin>(
190           ci::Plugin::ActionType::Uninstall);
191       AddStep<ci::pkgmgr::StepKillApps>();
192       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
193       AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
194       AddStep<ci::filesystem::StepRemovePerUserStorageDirectories>();
195       AddStep<ci::pkgmgr::StepUnregisterApplication>();
196       AddStep<ci::security::StepRollbackDeinstallationSecurity>();
197       AddStep<ci::filesystem::StepRemoveTep>();
198       AddStep<ci::filesystem::StepRemoveFiles>();
199       AddStep<ci::filesystem::StepRemoveZipImage>();
200       AddStep<ci::filesystem::StepRemoveIcons>();
201       AddStep<wgt::encryption::StepRemoveEncryptionData>();
202       AddStep<ci::security::StepRevokeSecurity>();
203       AddStep<ci::pkgmgr::StepRemoveManifest>();
204       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
205       break;
206     case ci::RequestType::Reinstall:
207       // RDS is not supported for hybrid apps
208       AddStep<ci::configuration::StepFail>();
209       break;
210     case ci::RequestType::Delta:
211       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
212       AddStep<ci::filesystem::StepUnzip>();
213       AddStep<ci::configuration::StepParseManifest>(
214           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
215           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
216       AddStep<hybrid::configuration::StepStashTpkConfig>();
217       AddStep<ci::configuration::StepParseManifest>(
218           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
219           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
220       AddStep<ci::filesystem::StepEnableExternalMount>();
221       AddStep<ci::filesystem::StepDeltaPatch>();
222       AddStep<ci::filesystem::StepDisableExternalMount>();
223       AddStep<wgt::configuration::StepParse>(
224           wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
225       AddStep<hybrid::configuration::StepMergeTpkConfig>();
226       AddStep<ci::configuration::StepCheckTizenVersion>();
227       AddStep<ci::security::StepCheckSignature>();
228       AddStep<ci::security::StepPrivilegeCompatibility>();
229       AddStep<wgt::security::StepCheckSettingsLevel>();
230       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
231       AddStep<wgt::security::StepCheckWgtNotificationCategory>();
232       AddStep<wgt::security::StepCheckWgtImePrivilege>();
233       AddStep<hybrid::encryption::StepEncryptResources>();
234       AddStep<ci::security::StepRollbackInstallationSecurity>();
235       AddStep<ci::configuration::StepBlockCrossUpdate>();
236       AddStep<ci::pkgmgr::StepKillApps>();
237       AddStep<ci::backup::StepBackupManifest>();
238       AddStep<ci::backup::StepBackupIcons>();
239       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
240       AddStep<ci::filesystem::StepAcquireExternalStorage>(true);
241       AddStep<ci::backup::StepCopyBackup>();
242       AddStep<ci::filesystem::StepUpdateTep>();
243       AddStep<tpk::filesystem::StepTpkPatchIcons>();
244       AddStep<wgt::filesystem::StepWgtPatchIcons>();
245       AddStep<ci::filesystem::StepCreateIcons>();
246       AddStep<wgt::filesystem::StepCopyPreviewIcons>();
247       AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
248       AddStep<ci::filesystem::StepCopyStorageDirectories>();
249       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
250       AddStep<tpk::filesystem::StepCreateSymbolicLink>();
251       AddStep<ci::security::StepUpdateSecurity>();
252       AddStep<wgt::pkgmgr::StepGenerateXml>();
253       AddStep<ci::pkgmgr::StepUpdateApplication>();
254       AddStep<ci::pkgmgr::StepRunParserPlugin>(
255           ci::Plugin::ActionType::Upgrade);
256       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
257       break;
258     case ci::RequestType::Recovery:
259       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
260       AddStep<ci::recovery::StepOpenRecoveryFile>();
261       AddStep<ci::configuration::StepParseManifest>(
262           ci::configuration::StepParseManifest::ManifestLocation::RECOVERY,
263           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
264       AddStep<ci::pkgmgr::StepRecoverApplication>();
265       AddStep<ci::filesystem::StepRemoveTemporaryDirectory>();
266       AddStep<ci::filesystem::StepRecoverIcons>();
267       AddStep<ci::filesystem::StepRecoverManifest>();
268       AddStep<ci::filesystem::StepRecoverExternalStorage>();
269       AddStep<ci::filesystem::StepRecoverStorageDirectories>();
270       AddStep<ci::filesystem::StepRecoverFiles>();
271       AddStep<ci::security::StepRecoverSecurity>();
272       break;
273     case ci::RequestType::Clear:
274       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
275       AddStep<ci::configuration::StepParseManifest>(
276           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
277           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
278       AddStep<ci::filesystem::StepClearData>();
279       break;
280     case ci::RequestType::MountInstall:
281       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
282       AddStep<ci::mount::StepMountUnpacked>();
283       AddStep<ci::configuration::StepParseManifest>(
284           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
285           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
286       AddStep<hybrid::configuration::StepStashTpkConfig>();
287       AddStep<wgt::configuration::StepParse>(
288           wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
289       AddStep<hybrid::configuration::StepMergeTpkConfig>();
290       AddStep<ci::configuration::StepParsePreload>();
291       AddStep<ci::pkgmgr::StepCheckRestriction>();
292       AddStep<ci::configuration::StepCheckTizenVersion>();
293       AddStep<ci::security::StepCheckSignature>();
294       AddStep<ci::security::StepPrivilegeCompatibility>();
295       AddStep<wgt::security::StepCheckSettingsLevel>();
296       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
297       AddStep<wgt::security::StepCheckWgtNotificationCategory>();
298       AddStep<wgt::security::StepCheckWgtImePrivilege>();
299       AddStep<hybrid::encryption::StepEncryptResources>();
300       AddStep<ci::security::StepRollbackInstallationSecurity>();
301       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
302       AddStep<ci::mount::StepMountInstall>();
303       AddStep<tpk::filesystem::StepTpkPreparePackageDirectory>();
304       AddStep<ci::filesystem::StepCopyTep>();
305       AddStep<tpk::filesystem::StepTpkPatchIcons>();
306       AddStep<wgt::filesystem::StepWgtPatchIcons>();
307       AddStep<ci::filesystem::StepCreateIcons>();
308       AddStep<wgt::filesystem::StepCopyPreviewIcons>();
309       AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
310       AddStep<ci::filesystem::StepCreateStorageDirectories>();
311       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
312       AddStep<tpk::filesystem::StepCreateSymbolicLink>();
313       AddStep<wgt::pkgmgr::StepGenerateXml>();
314       AddStep<ci::pkgmgr::StepRunParserPlugin>(
315           ci::Plugin::ActionType::Install);
316       AddStep<ci::pkgmgr::StepRegisterApplication>();
317       AddStep<ci::security::StepRegisterSecurity>();
318       AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
319       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
320       break;
321     case ci::RequestType::MountUpdate:
322       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
323       AddStep<ci::mount::StepMountUnpacked>();
324       AddStep<ci::configuration::StepParseManifest>(
325           ci::configuration::StepParseManifest::ManifestLocation::PACKAGE,
326           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
327       AddStep<hybrid::configuration::StepStashTpkConfig>();
328       AddStep<wgt::configuration::StepParse>(
329           wgt::configuration::StepParse::ConfigLocation::RESOURCE_WGT, true);
330       AddStep<hybrid::configuration::StepMergeTpkConfig>();
331       AddStep<ci::configuration::StepParsePreload>();
332       AddStep<ci::configuration::StepCheckTizenVersion>();
333       AddStep<ci::security::StepCheckSignature>();
334       AddStep<ci::security::StepPrivilegeCompatibility>();
335       AddStep<wgt::security::StepCheckSettingsLevel>();
336       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
337       AddStep<wgt::security::StepCheckWgtNotificationCategory>();
338       AddStep<wgt::security::StepCheckWgtImePrivilege>();
339       AddStep<hybrid::encryption::StepEncryptResources>();
340       AddStep<ci::security::StepRollbackInstallationSecurity>();
341       AddStep<ci::configuration::StepParseManifest>(
342           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
343           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
344       AddStep<ci::configuration::StepBlockCrossUpdate>();
345       AddStep<ci::pkgmgr::StepKillApps>();
346       AddStep<ci::backup::StepBackupManifest>();
347       AddStep<ci::backup::StepBackupIcons>();
348       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
349       AddStep<ci::mount::StepMountUpdate>();
350       AddStep<tpk::filesystem::StepTpkUpdatePackageDirectory>();
351       AddStep<ci::filesystem::StepUpdateTep>();
352       AddStep<tpk::filesystem::StepTpkPatchIcons>();
353       AddStep<wgt::filesystem::StepWgtPatchIcons>();
354       AddStep<ci::filesystem::StepCreateIcons>();
355       AddStep<wgt::filesystem::StepCopyPreviewIcons>();
356       AddStep<wgt::filesystem::StepWgtPatchStorageDirectories>();
357       AddStep<wgt::filesystem::StepCreateSymbolicLink>();
358       AddStep<tpk::filesystem::StepCreateSymbolicLink>();
359       AddStep<ci::security::StepUpdateSecurity>();
360       AddStep<wgt::pkgmgr::StepGenerateXml>();
361       AddStep<ci::pkgmgr::StepUpdateApplication>();
362       AddStep<ci::pkgmgr::StepRunParserPlugin>(
363           ci::Plugin::ActionType::Upgrade);
364       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
365       break;
366     case ci::RequestType::ManifestDirectInstall:
367       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
368       AddStep<ci::configuration::StepParseManifest>(
369           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
370           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
371       AddStep<hybrid::configuration::StepStashTpkConfig>();
372       AddStep<wgt::configuration::StepParse>(
373           wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
374       AddStep<hybrid::configuration::StepMergeTpkConfig>();
375       AddStep<ci::configuration::StepParsePreload>();
376       AddStep<ci::configuration::StepCheckTizenVersion>();
377       AddStep<ci::security::StepCheckSignature>();
378       AddStep<ci::security::StepPrivilegeCompatibility>();
379       AddStep<wgt::security::StepCheckSettingsLevel>();
380       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
381       AddStep<ci::security::StepRollbackInstallationSecurity>();
382       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
383       AddStep<wgt::pkgmgr::StepGenerateXml>();
384       AddStep<ci::pkgmgr::StepRunParserPlugin>(
385           ci::Plugin::ActionType::Install);
386       AddStep<ci::pkgmgr::StepRegisterApplication>();
387       AddStep<ci::security::StepRegisterSecurity>();
388       AddStep<ci::filesystem::StepCreatePerUserStorageDirectories>();
389       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
390       break;
391     case ci::RequestType::ManifestDirectUpdate:
392       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
393       AddStep<ci::filesystem::StepUnzip>();
394       AddStep<ci::configuration::StepParseManifest>(
395           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
396           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
397       AddStep<hybrid::configuration::StepStashTpkConfig>();
398       AddStep<wgt::configuration::StepParse>(
399           wgt::configuration::StepParse::ConfigLocation::INSTALLED, true);
400       AddStep<hybrid::configuration::StepMergeTpkConfig>();
401       AddStep<ci::configuration::StepParsePreload>();
402       AddStep<ci::configuration::StepCheckTizenVersion>();
403       AddStep<ci::security::StepCheckSignature>();
404       AddStep<ci::security::StepPrivilegeCompatibility>();
405       AddStep<wgt::security::StepCheckSettingsLevel>();
406       AddStep<wgt::security::StepCheckWgtBackgroundCategory>();
407       AddStep<ci::security::StepRollbackInstallationSecurity>();
408       AddStep<ci::configuration::StepParseManifest>(
409           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
410           ci::configuration::StepParseManifest::StoreLocation::BACKUP);
411       AddStep<ci::pkgmgr::StepKillApps>();
412       AddStep<ci::security::StepUpdateSecurity>();
413       AddStep<ci::filesystem::StepRemoveGlobalAppSymlinks>();
414       AddStep<wgt::pkgmgr::StepGenerateXml>();
415       AddStep<ci::pkgmgr::StepUpdateApplication>();
416       AddStep<ci::pkgmgr::StepRunParserPlugin>(
417           ci::Plugin::ActionType::Upgrade);
418       AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
419       break;
420     case ci::RequestType::EnablePkg:
421       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
422       AddStep<ci::configuration::StepParseManifest>(
423           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
424           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
425       AddStep<ci::pkgmgr::StepKillApps>();
426       AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
427         ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Enable);
428       AddStep<ci::pkgmgr::StepRunParserPlugin>(
429         ci::Plugin::ActionType::Uninstall);
430       break;
431     case ci::RequestType::DisablePkg:
432       AddStep<ci::configuration::StepConfigure>(pkgmgr_);
433       AddStep<ci::configuration::StepParseManifest>(
434           ci::configuration::StepParseManifest::ManifestLocation::INSTALLED,
435           ci::configuration::StepParseManifest::StoreLocation::NORMAL);
436       AddStep<ci::pkgmgr::StepKillApps>();
437       AddStep<ci::pkgmgr::StepUpdatePkgDisableInfo>(
438         ci::pkgmgr::StepUpdatePkgDisableInfo::ActionType::Disable);
439       AddStep<ci::pkgmgr::StepRunParserPlugin>(
440         ci::Plugin::ActionType::Uninstall);
441       break;
442     default:
443       AddStep<ci::configuration::StepFail>();
444       break;
445   }
446 }
447
448 }  // namespace hybrid
449