static const DPL::String SETTING_VALUE_ENCRYPTION = L"encryption";
static const DPL::String SETTING_VALUE_ENCRYPTION_ENABLE = L"enable";
const DPL::String SETTING_VALUE_INSTALLTOEXT_NAME =
- L"install-location-type";
+ L"install-location";
const DPL::String SETTING_VALUE_INSTALLTOEXT_PREPER_EXT =
L"prefer-external";
namespace {
const char* GLIST_RES_DIR = "res";
-const char* GLIST_BIN_DIR = "bin";
bool _FolderCopy(std::string source, std::string dest)
{
m_extHandle(NULL)
{
if (INSTALL_LOCATION_TYPE_EXTERNAL !=
- m_context.locationType)
+ m_context.locationType)
{
AddStep(&TaskFileManipulation::StepCreateDirs);
AddStep(&TaskFileManipulation::StepCreatePrivateStorageDir);
{
LogDebug("Step prepare to install in exernal directory");
Try {
- std::string appid =
- DPL::ToUTF8String(m_context.widgetConfig.tzAppid);
+ std::string pkgid =
+ DPL::ToUTF8String(m_context.widgetConfig.tzPkgid);
- WidgetInstallToExtSingleton::Instance().initialize(appid);
+ WidgetInstallToExtSingleton::Instance().initialize(pkgid);
size_t totalSize =
Utils::getFolderSize(m_context.locations->getTemporaryPackageDir());
GList *list = NULL;
app2ext_dir_details* dirDetail = NULL;
- std::string dirNames[2] = { GLIST_RES_DIR, GLIST_BIN_DIR };
-
- for (int i = 0; i < 2; i++) {
- dirDetail = (app2ext_dir_details*) calloc(1,
- sizeof(
- app2ext_dir_details));
- if (NULL == dirDetail) {
- ThrowMsg(Exceptions::ErrorExternalInstallingFailure,
- "error in app2ext");
- }
- dirDetail->name = strdup(dirNames[i].c_str());
- dirDetail->type = APP2EXT_DIR_RO;
- list = g_list_append(list, dirDetail);
+ dirDetail = (app2ext_dir_details*) calloc(1,
+ sizeof(
+ app2ext_dir_details));
+ if (NULL == dirDetail) {
+ ThrowMsg(Exceptions::ErrorExternalInstallingFailure,
+ "error in app2ext");
}
+ dirDetail->name = strdup(GLIST_RES_DIR);
+ dirDetail->type = APP2EXT_DIR_RO;
+ list = g_list_append(list, dirDetail);
if (m_context.isUpdateMode) {
WidgetInstallToExtSingleton::Instance().preUpgrade(list,
}
free(dirDetail);
g_list_free(list);
+
+ /* make bin directory */
+ std::string widgetBinPath = m_context.locations->getBinaryDir();
+ WrtUtilMakeDir(widgetBinPath);
}
Catch(WidgetInstallToExt::Exception::ErrorInstallToExt)
{
m_context.removeAbnormal = false;
m_context.uninstallStep = UninstallerContext::UNINSTALL_START;
m_context.job = this;
- m_context.isExternalWidget = getExternalWidgetFlag();
Try
{
m_exceptionCaught = static_cast<Jobs::Exceptions::Type>(e.getParam());
m_exceptionMessage = e.GetMessage();
}
-
-bool JobWidgetUninstall::getExternalWidgetFlag() const
-{
- LogDebug("Get external widget");
- if (APP2EXT_SD_CARD ==
- app2ext_get_app_location(m_context.tzAppid.c_str()))
- {
- LogDebug("This widget is in external stroage");
- return true;
- }
- return false;
-}
} //namespace WidgetUninstall
} //namespace Jobs
std::string getRemovedTizenId() const;
bool getRemoveStartedFlag() const;
bool getRemoveFinishedFlag() const;
- bool getExternalWidgetFlag() const;
enum class WidgetStatus
{
DPL::TaskDecl<TaskRemoveFiles>(this),
m_context(context)
{
- if (!m_context.isExternalWidget) {
- AddStep(&TaskRemoveFiles::StepRemoveInstallationDirectory);
- } else {
- AddStep(&TaskRemoveFiles::StepRemoveExternalWidget);
- }
+ AddStep(&TaskRemoveFiles::StepRemoveInstallationDirectory);
AddStep(&TaskRemoveFiles::StepRemoveManifest);
AddStep(&TaskRemoveFiles::StepRemoveExternalLocations);
AddStep(&TaskRemoveFiles::StepRemoveVconf);
void TaskRemoveFiles::StepRemoveInstallationDirectory()
{
LogInfo("StepRemoveInstallationDirectory started");
-
- m_context.removeStarted = true;
- std::string widgetDir =
- m_context.locations->getPackageInstallationDir();
- if (!WrtUtilRemove(widgetDir)) {
- LogWarning("Removing widget installation directory failed");
- }
- std::string dataDir = m_context.locations->getUserDataRootDir();
- if (!WrtUtilRemove(dataDir)) {
- LogWarning(dataDir + " is already removed");
+ if (APP2EXT_SD_CARD !=
+ app2ext_get_app_location(m_context.tzPkgid.c_str()))
+ {
+ LogDebug("Removing directory");
+ m_context.removeStarted = true;
+ std::string widgetDir =
+ m_context.locations->getPackageInstallationDir();
+ if (!WrtUtilRemove(widgetDir)) {
+ LogWarning("Removing widget installation directory failed");
+ }
+ std::string dataDir = m_context.locations->getUserDataRootDir();
+ if (!WrtUtilRemove(dataDir)) {
+ LogWarning(dataDir + " is already removed");
+ }
+ } else {
+ LogDebug("Removing sdcard directory");
+ Try {
+ WidgetInstallToExtSingleton::Instance().initialize(m_context.tzPkgid);
+ WidgetInstallToExtSingleton::Instance().uninstallation();
+ WidgetInstallToExtSingleton::Instance().deinitialize();
+ }
+ Catch(WidgetInstallToExt::Exception::ErrorInstallToExt)
+ {
+ Throw(Jobs::WidgetUninstall::TaskRemoveFiles::Exception::
+ RemoveFilesFailed);
+ }
}
m_context.job->UpdateProgress(
UninstallerContext::UNINSTALL_REMOVE_WIDGETDIR,
}
}
}
-
-void TaskRemoveFiles::StepRemoveExternalWidget()
-{
- Try {
- WidgetInstallToExtSingleton::Instance().initialize(m_context.tzPkgid);
- WidgetInstallToExtSingleton::Instance().uninstallation();
- WidgetInstallToExtSingleton::Instance().deinitialize();
- }
- Catch(WidgetInstallToExt::Exception::ErrorInstallToExt)
- {
- Throw(
- Jobs::WidgetUninstall::TaskRemoveFiles::Exception::
- RemoveFilesFailed);
- }
-}
} //namespace WidgetUninstall
} //namespace Jobs
void StepRemoveManifest();
void StepRemoveExternalLocations();
void StepRemoveVconf();
- void StepRemoveExternalWidget();
public:
explicit TaskRemoveFiles(UninstallerContext& context);
Jobs::WidgetUninstall::JobWidgetUninstall *job;
std::string tzAppid;
std::string tzPkgid;
- bool isExternalWidget;
bool removeAbnormal;
};