AddStep<ci::filesystem::StepRemoveTep>();
AddStep<ci::security::StepRevokeSecurity>();
AddStep<ci::pkgmgr::StepRemoveManifest>();
- AddStep<ci::filesystem::StepCreateGlobalAppSymlinks>();
}
void AppInstaller::ReinstallSteps() {
namespace filesystem {
common_installer::Step::Status StepCreateGlobalAppSymlinks::process() {
- if (context_->is_readonly_package.get())
+ if (context_->is_readonly_package.get() ||
+ context_->request_mode.get() == RequestMode::USER)
return Step::Status::OK;
- std::string package_id = context_->pkgid.get();
- if (context_->request_type.get() == RequestType::Uninstall) {
- PkgQueryInterface pkg_query(context_->pkgid.get(), kGlobalUserUid);
- if ((context_->request_mode.get() == RequestMode::USER) &&
- pkg_query.IsPackageInstalled()) {
- LOG(INFO) << "Creating globalapp symlinks for current user, package: "
- << package_id;
- if (!CreateGlobalAppSymlinksForUser(package_id, context_->uid.get())) {
- LOG(ERROR) << "Failed to create globalapp symlinks";
- return Status::GLOBALSYMLINK_ERROR;
- }
- }
- } else {
- if (context_->request_mode.get() == RequestMode::GLOBAL) {
- LOG(INFO) << "Creating globalapp symlinks for all user, package: "
- << package_id;
- if (!CreateGlobalAppSymlinksForAllUsers(package_id)) {
- LOG(ERROR) << "Failed to create globalapp symlinks";
- return Status::GLOBALSYMLINK_ERROR;
- }
- }
+ std::string package_id = context_->pkgid.get();
+ LOG(INFO) << "Creating globalapp symlinks for all user, package: "
+ << package_id;
+ if (!CreateGlobalAppSymlinksForAllUsers(package_id)) {
+ LOG(ERROR) << "Failed to create globalapp symlinks";
+ return Status::GLOBALSYMLINK_ERROR;
}
return Status::OK;