ace_policy_result_t policyResult = ACE_DENY;
//TODO: remove dao.getHandle()
- ace_return_t ret = ace_get_policy_result(
- const_cast<const ace_resource_t>(devCapStr.c_str()),
- dao.getHandle(),
- &policyResult);
- if (ACE_OK != ret) {
- ThrowMsg(Exceptions::AceCheckFailed, "Instalation failure. "
- "ACE check failure");
+ if (m_context.job->getInstallerStruct().m_installMode
+ == InstallMode::INSTALL_MODE_PRELOAD)
+ {
+ LogDebug("This widget is prealoaded. So ace check will be skiped");
+ policyResult = ACE_PERMIT;
+ } else {
+ ace_return_t ret = ace_get_policy_result(
+ const_cast<const ace_resource_t>(devCapStr.c_str()),
+ dao.getHandle(),
+ &policyResult);
+ if (ACE_OK != ret) {
+ ThrowMsg(Exceptions::AceCheckFailed, "Instalation failure. "
+ "ACE check failure");
+ }
}
LogInfo("PolicyResult is : " << static_cast<int>(policyResult));
LogDebug("Create resource directory");
WrtUtilMakeDir(widgetBinPath);
WrtUtilMakeDir(widgetSrcPath);
+ if (m_context.job->getInstallerStruct().m_installMode
+ == InstallMode::INSTALL_MODE_PRELOAD)
+ {
+ std::string userWidgetDir = m_context.locations->getUserDataRootDir();
+ WrtUtilMakeDir(userWidgetDir);
+ }
}
m_context.job->UpdateProgress(
WrtDB::GlobalConfig::GetWidgetSrcPath();
if (0 != access(srcDir.c_str(), F_OK)) {
- LogDebug("Make symbolic name for preaload app" << " to " << srcDir <<
- "from " << m_context.locations->getSourceDir());
+ LogDebug("Make symbolic name for preaload app" <<
+ m_context.locations->getSourceDir() << " to " << srcDir);
std::string resDir = m_context.locations->getUserDataRootDir() +
"/res";
std::string storagePath = m_context.locations->getPrivateStorageDir();
std::string dataDir = m_context.locations->getPackageInstallationDir() +
"/" + WrtDB::GlobalConfig::GetWidgetPrivateStoragePath();
+ if (0 != access(dataDir.c_str(), F_OK)) {
+ LogDebug("Make symbolic name for preaload app " <<
+ storagePath << " to " << dataDir);
+
+ if (symlink(storagePath.c_str(), dataDir.c_str()) != 0)
+ {
+ int error = errno;
+ if (error)
+ LogPedantic("Failed to make a symbolic name for a file "
+ << "[" << DPL::GetErrnoString(error) << "]");
+ ThrowMsg(Exceptions::FileOperationFailed,
+ "Symbolic link creating is not done.");
+ }
+ changeOwnerForDirectory(dataDir);
+ }
+
+ if (m_context.widgetConfig.packagingType != PKG_TYPE_HYBRID_WEB_APP) {
+ std::string widgetBinPath = m_context.locations->getBinaryDir();
+ std::string userBinPath = m_context.locations->getUserBinaryDir();
+ LogDebug("Make symbolic link for preload app " << widgetBinPath <<
+ " to " << userBinPath);
+ if (symlink(widgetBinPath.c_str(), userBinPath.c_str()) != 0)
+ {
+ int error = errno;
+ if (error)
+ LogPedantic("Failed to make a symbolic name for a file "
+ << "[" << DPL::GetErrnoString(error) << "]");
+ ThrowMsg(Exceptions::FileOperationFailed,
+ "Symbolic link creating is not done.");
+ }
- if (symlink(storagePath.c_str(), dataDir.c_str()) != 0)
- {
- int error = errno;
- if (error)
- LogPedantic("Failed to make a symbolic name for a file "
- << "[" << DPL::GetErrnoString(error) << "]");
- ThrowMsg(Exceptions::FileOperationFailed,
- "Symbolic link creating is not done.");
}
- changeOwnerForDirectory(dataDir);
}
}
LogDebug(
"Removing widget installation temporary directory: " << m_dirpath.c_str());
if (!WrtUtilRemove(m_dirpath)) {
- LogError("Fail at removing directory: " << m_dirpath.c_str());
+ LogWarning("Fail at removing directory: " << m_dirpath.c_str());
}
}
+ m_pkgid + WrtDB::GlobalConfig::GetUserWidgetExecPath();
}
+std::string WidgetLocation::getUserBinaryDir() const
+{
+ return getUserDataRootDir() + "/"
+ + WrtDB::GlobalConfig::GetUserWidgetExecPath();
+}
+
std::string WidgetLocation::getExecFile() const
{
return getBinaryDir() + "/" + m_appid;
std::string getInstallationDir() const; // /opt/apps or /usr/apps
std::string getPackageInstallationDir() const; // /opt/apps/[package]
std::string getSourceDir() const; // /opt/apps/[package]/res/wgt
- std::string getBinaryDir() const; // /opt/apps/[package]/bin
+ std::string getBinaryDir() const; // /opt/apps/[package]/bin or /usr/apps/[package]/bin
+ std::string getUserBinaryDir() const; // /opt/apps/[package]/bin
std::string getExecFile() const; // /opt/apps/[package]/bin/[package]
std::string getBackupDir() const; // /opt/apps/[package]/backup
std::string getBackupSourceDir() const; // /opt/apps/[pkg]/backup/res/wgt