-#git:framework/web/wrt-installer wrt-installer_0.1.53
+#git:framework/web/wrt-installer wrt-installer_0.1.54
Name: wrt-installer
Summary: Installer for tizen Webruntime
-Version: 0.1.53
+Version: 0.1.54
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
ErrorInstallOspServcie, ///< Failure in installing osp service
ErrorPluginInstallationFailed, ///< failure in plugin installation
ErrorWidgetUninstallationFailed, ///< failure in uninstallation
+ ErrorNotSupportRDSUpdate, ///< failure in rds update
ErrorUnknown = 140, ///< do not use this error code.
};
static const DPL::String SETTING_VALUE_ENCRYPTION = L"encryption";
static const DPL::String SETTING_VALUE_ENCRYPTION_ENABLE = L"enable";
+static const DPL::String SETTING_VALUE_ENCRYPTION_DISABLE = L"disable";
const DPL::String SETTING_VALUE_INSTALLTOEXT_NAME =
L"install-location";
const DPL::String SETTING_VALUE_INSTALLTOEXT_PREPER_EXT =
} else if (m_result == ConfigureResult::Failed_DrmError) {
ThrowMsg(Jobs::WidgetInstall::Exceptions::DRMFailed,
"drm failed");
+ } else if (m_result == ConfigureResult::Failed_NotSupportRDSUpdate) {
+ ThrowMsg(Jobs::WidgetInstall::Exceptions::NotSupportRDSUpdate,
+ "RDS update failed");
} else {
ThrowMsg(Jobs::WidgetInstall::Exceptions::NotAllowed,
"widget installation or update not allowed!");
// Already installed TizenAppId. return failed
return ConfigureResult::Failed_AlreadyInstalled;
}
+ if (!checkSupportRDSUpdate(configData)) {
+ return ConfigureResult::Failed_NotSupportRDSUpdate;
+ }
m_installerContext.isUpdateMode = true;
}
Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) {
/* TODO */
return false;
}
+
+bool JobWidgetInstall::checkSupportRDSUpdate(const WrtDB::ConfigParserData
+ &configInfo)
+{
+ if (m_installerContext.mode.command ==
+ InstallMode::Command::REINSTALL)
+ {
+ DPL::String configValue = SETTING_VALUE_ENCRYPTION_DISABLE;
+ DPL::String dbValue = SETTING_VALUE_ENCRYPTION_DISABLE;
+
+ WidgetDAOReadOnly dao(m_installerContext.widgetConfig.tzAppid);
+ WrtDB::WidgetSettings widgetSettings;
+ dao.getWidgetSettings(widgetSettings);
+
+ FOREACH(it, widgetSettings) {
+ if (it->settingName == SETTING_VALUE_ENCRYPTION) {
+ dbValue = it->settingValue;
+ }
+ }
+
+ FOREACH(data, configInfo.settingsList)
+ {
+ if (data->m_name == SETTING_VALUE_ENCRYPTION)
+ {
+ configValue = data->m_value;
+ }
+ }
+ if (configValue != dbValue) {
+ LogError("Not Support RDS mode because of encryption setting");
+ return false;
+ }
+ }
+
+ return true;
+}
} //namespace WidgetInstall
} //namespace Jobs
Failed_AlreadyInstalled,
Failed_WidgetRunning,
Failed_DrmError,
+ Failed_NotSupportRDSUpdate,
};
class JobWidgetInstall :
bool validateTizenPackageID(const WrtDB::TizenPkgId &tizenPkgId);
ConfigureResult checkWidgetUpdate(const WidgetUpdateInfo &update);
void setApplicationType(const WrtDB::ConfigParserData &configInfo);
+ bool checkSupportRDSUpdate(const WrtDB::ConfigParserData &configInfo);
public:
/**
AddAbortStep(&TaskFileManipulation::StepAbortRenamePath);
}
AddStep(&TaskFileManipulation::StepCreatePrivateStorageDir);
+ AddStep(&TaskFileManipulation::StepCreateSharedFolder);
AddStep(&TaskFileManipulation::StepLinkForPreload);
} else {
AddStep(&TaskFileManipulation::StepPrepareExternalDir);
AddStep(&TaskFileManipulation::StepInstallToExternal);
AddStep(&TaskFileManipulation::StepCreatePrivateStorageDir);
+ AddStep(&TaskFileManipulation::StepCreateSharedFolder);
AddAbortStep(&TaskFileManipulation::StepAbortCreateExternalDir);
}
}
WidgetInstallToExtSingleton::Instance().deinitialize();
}
+
+void TaskFileManipulation::StepCreateSharedFolder()
+{
+ LogDebug("StepCreateSharedFolder");
+ std::string sharedPath = m_context.locations->getSharedRootDir();
+ LogDebug("Create shared directory : " <<
+ m_context.locations->getSharedRootDir());
+
+ WrtUtilMakeDir(sharedPath);
+
+ if (m_context.isUpdateMode) { //update
+ std::string backData = m_context.locations->getBackupSharedDir();
+ LogDebug("copy shared storage " << backData << " to " << sharedPath);
+ if (!DirectoryApi::DirectoryCopy(backData, sharedPath)) {
+ LogError("Failed to rename " << backData << " to " << sharedPath);
+ ThrowMsg(Exceptions::BackupFailed,
+ "Error occurs copy shared strage files");
+ }
+ } else {
+ WrtUtilMakeDir(m_context.locations->getSharedResourceDir());
+ WrtUtilMakeDir(m_context.locations->getSharedDataDir());
+ WrtUtilMakeDir(m_context.locations->getSharedTrustedDir());
+ }
+}
} //namespace WidgetInstall
} //namespace Jobs
void StepCreateDirs();
void StepRenamePath();
void StepCreatePrivateStorageDir();
+ void StepCreateSharedFolder();
void StepAbortRenamePath();
void StepLinkForPreload();
LogDebug("backup resource directory path : " << backPath);
std::string pkgPath = m_context.locations->getPackageInstallationDir();
+ if (0 == access(backPath.c_str(), F_OK)) {
+ WrtUtilRemove(backPath);
+ }
LogDebug("copy : " << pkgPath << " to " << backPath);
if ((rename(pkgPath.c_str(), backPath.c_str())) != 0) {
LogError("Failed to rename " << pkgPath << " to " << backPath);
DECLARE_JOB_EXCEPTION(Base, EncryptionFailed, ErrorEncryptionFailed)
DECLARE_JOB_EXCEPTION(Base, InstallOspsvcFailed, ErrorInstallOspServcie)
DECLARE_JOB_EXCEPTION(Base, PrivilegeLevelViolation, ErrorPrivilegeLevelViolation)
+DECLARE_JOB_EXCEPTION(Base, NotSupportRDSUpdate, ErrorNotSupportRDSUpdate)
} //namespace
} //namespace
} //namespace
{
m_appid = appid;
}
+
+std::string WidgetLocation::getSharedRootDir() const
+{
+ /* TODO : add wrt-commons*/
+ return getUserDataRootDir() + "/shared";
+}
+
+std::string WidgetLocation::getSharedResourceDir() const
+{
+ return getSharedRootDir() + "/res";
+}
+
+std::string WidgetLocation::getSharedDataDir() const
+{
+ return getSharedRootDir() + "/data";
+}
+
+std::string WidgetLocation::getSharedTrustedDir() const
+{
+ return getSharedRootDir() + "/trusted";
+}
+
+std::string WidgetLocation::getBackupSharedDir() const
+{
+ return getBackupDir() + "/shared";
+}
std::string getBackupPrivateDir() const; // /opt/apps/[pkg].backup/data
std::string getUserDataRootDir() const; // /opt/usr/apps/[package]
std::string getPrivateStorageDir() const; // /opt/usr/apps/[package]/data
+ std::string getSharedRootDir() const; // /opt/usr/apps/[package]/shared
+ std::string getSharedResourceDir() const; // /opt/usr/apps/[package]/shared/res
+ std::string getSharedDataDir() const; // /opt/usr/apps/[package]/shared/data
+ std::string getSharedTrustedDir() const; // /opt/usr/apps/[package]/shared/trusted
+ std::string getBackupSharedDir() const; // /opt/usr/apps/[package].backup/shared
// Temporary paths
/**