#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <dpl/utils/wrt_utility.h>
+#include <dpl/wrt-dao-rw/widget_dao.h>
#include <widget_install/job_widget_install.h>
#include <widget_install/widget_install_errors.h>
#include <widget_install/widget_install_context.h>
DPL::TaskDecl<TaskRemoveBackupFiles>(this),
m_context(context)
{
- AddStep(&TaskRemoveBackupFiles::StepRemoveBackupFiles);
+ if (m_context.widgetConfig.packagingType !=
+ WrtDB::PKG_TYPE_DIRECTORY_WEB_APP)
+ {
+ AddStep(&TaskRemoveBackupFiles::StepRemoveBackupFiles);
+ }
+ AddStep(&TaskRemoveBackupFiles::StepDeleteBackupDB);
}
void TaskRemoveBackupFiles::StepRemoveBackupFiles()
LogDebug("Success to remove temp directory : " << tmp);
} else {
LogError("Failed to remove temp directory : " << tmp);
- ThrowMsg(Exceptions::RemoveBackupFailed,
- "Error occurs during removing existing folder");
}
+}
- m_context.job->UpdateProgress(
- InstallerContext::INSTALL_REMOVE_BACKUP_FILE,
- "Backup widget file delete Finished");
+void TaskRemoveBackupFiles::StepDeleteBackupDB()
+{
+ LogDebug("StepDeleteBackupDB");
+ std::string oldAppid =
+ DPL::ToUTF8String(m_context.widgetConfig.tzAppid) + ".backup";
+
+ Try
+ {
+ WidgetDAO::unregisterWidget(DPL::FromUTF8String(oldAppid));
+ }
+ Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
+ {
+ LogError("Fail to delete old version db information");
+ }
}
+
} //namespace WidgetInstall
} //namespace Jobs