{
INSTALL_LOCATION_TYPE_UNKNOWN = 0,
INSTALL_LOCATION_TYPE_NOMAL,
- INSTALL_LOCATION_TYPE_PRELOAD,
INSTALL_LOCATION_TYPE_EXTERNAL
};
} else {
tempDir =
Jobs::WidgetInstall::createTempPath(
- m_installerContext.mode.installTime ==
- InstallMode::InstallTime::PRELOAD);
+ m_installerContext.mode.rootPath ==
+ InstallMode::RootPath::RO);
}
m_isDRM = isDRMWidget(widgetPath);
tzPkgid),
widgetPath, tempPath,
m_installerContext.widgetConfig.packagingType,
- m_installerContext.locationType);
+ m_installerContext.mode.rootPath ==
+ InstallMode::RootPath::RO);
m_installerContext.locations->registerAppid(
DPL::ToUTF8String(m_installerContext.widgetConfig.tzAppid));
}
void JobWidgetInstall::setInstallLocationType(
- const
- WrtDB::ConfigParserData &
- configData)
+ const WrtDB::ConfigParserData & configData)
{
m_installerContext.locationType = INSTALL_LOCATION_TYPE_NOMAL;
-
- if (m_installerContext.mode.installTime == InstallMode::InstallTime::PRELOAD) {
- m_installerContext.locationType =
- INSTALL_LOCATION_TYPE_PRELOAD;
- } else {
- FOREACH(it, configData.settingsList)
- {
+ if (m_installerContext.mode.installTime != InstallMode::InstallTime::PRELOAD) {
+ FOREACH(it, configData.settingsList) {
if (it->m_name == SETTING_VALUE_INSTALLTOEXT_NAME &&
it->m_value ==
SETTING_VALUE_INSTALLTOEXT_PREPER_EXT)
namespace WidgetInstall {
//TODO make directory like jobs common?
-std::string createTempPath(bool preload = false);
+std::string createTempPath(bool isReadOnly = false);
void createTempPath(const std::string& path);
} // WidgetInstall
} // Jobs
void TaskFileManipulation::StepLinkForPreload()
{
- if (m_context.mode.installTime == InstallMode::InstallTime::PRELOAD) {
+ if (m_context.mode.rootPath == InstallMode::RootPath::RO) {
std::string srcDir = m_context.locations->getUserDataRootDir() +
WrtDB::GlobalConfig::GetWidgetSrcPath();
LogDebug("Commiting manifest file : " << manifest_file);
std::ostringstream destFile;
- if (m_context.mode.installTime == InstallMode::InstallTime::PRELOAD) {
+ if (m_context.mode.rootPath == InstallMode::RootPath::RO) {
destFile << "/usr/share/packages" << "/"; //TODO constant with path
} else {
destFile << "/opt/share/packages" << "/"; //TODO constant with path
#include <dpl/log/log.h>
#include <dpl/sstream.h>
#include <dpl/localization/localization_utils.h>
-
#include <widget_install/task_commons.h>
-WidgetLocation::DirectoryDeletor::DirectoryDeletor(bool isPreload) :
- m_dirpath(Jobs::WidgetInstall::createTempPath(isPreload))
+WidgetLocation::DirectoryDeletor::DirectoryDeletor(bool isReadOnly) :
+ m_dirpath(Jobs::WidgetInstall::createTempPath(isReadOnly))
{}
WidgetLocation::DirectoryDeletor::DirectoryDeletor(std::string tempPath) :
WidgetLocation::WidgetLocation(const std::string & widgetname,
std::string sourcePath,
WrtDB::PackagingType t,
- InstallLocationType locationType) :
+ bool isReadonly) :
m_pkgid(widgetname),
m_widgetSource(sourcePath),
m_type(t),
m_temp(
- new WidgetLocation::DirectoryDeletor(
- INSTALL_LOCATION_TYPE_PRELOAD == locationType))
+ new WidgetLocation::DirectoryDeletor(isReadonly))
{
- if (INSTALL_LOCATION_TYPE_PRELOAD == locationType) {
+ if (isReadonly) {
m_installedPath += WrtDB::GlobalConfig::GetUserPreloadedWidgetPath();
} else {
m_installedPath += WrtDB::GlobalConfig::GetUserInstalledWidgetPath();
std::string sourcePath,
std::string dirPath,
WrtDB::PackagingType t,
- InstallLocationType locationType) :
+ bool isReadonly) :
m_pkgid(widgetname),
m_widgetSource(sourcePath),
m_type(t),
- m_temp(new
- WidgetLocation::DirectoryDeletor(dirPath))
+ m_temp(new WidgetLocation::DirectoryDeletor(dirPath))
{
- if (INSTALL_LOCATION_TYPE_PRELOAD == locationType) {
+ if (isReadonly) {
m_installedPath += WrtDB::GlobalConfig::GetUserPreloadedWidgetPath();
} else {
m_installedPath += WrtDB::GlobalConfig::GetUserInstalledWidgetPath();
*/
WidgetLocation(const std::string & widgetname, std::string sourcePath,
WrtDB::PackagingType t = WrtDB::PKG_TYPE_NOMAL_WEB_APP,
- InstallLocationType ltype =
- INSTALL_LOCATION_TYPE_NOMAL);
+ bool isReadonly = false);
WidgetLocation(const std::string & widgetname, std::string sourcePath,
std::string dirPath,
WrtDB::PackagingType t = WrtDB::PKG_TYPE_NOMAL_WEB_APP,
- InstallLocationType ltype =
- INSTALL_LOCATION_TYPE_NOMAL);
+ bool isReadonly = false);
~WidgetLocation();
}
m_packagePath = m_argv[2];
m_installMode.installTime = InstallMode::InstallTime::PRELOAD;
+ m_installMode.rootPath = InstallMode::RootPath::RO;
+ AddStep(&WrtInstaller::installStep);
+ } else if (arg == "-ipw" || arg == "--install-preload-writable") {
+ LogDebug("Install preload web application to writable storage");
+ if (m_argc != 3) {
+ return showHelpAndQuit();
+ }
+ m_packagePath = m_argv[2];
+ m_installMode.installTime = InstallMode::InstallTime::PRELOAD;
+ m_installMode.rootPath = InstallMode::RootPath::RW;
AddStep(&WrtInstaller::installStep);
} else if (arg == "-c" || arg == "--csc-update") {
// "path=/opt/system/csc/Ozq2iEG15R-2.0.0-arm.wgt:op=install:removable=true"