Update wrt-installer_0.0.53
[framework/web/wrt-installer.git] / src / jobs / widget_install / task_unzip.cpp
index 65282d8..dd9bdc8 100644 (file)
@@ -29,6 +29,7 @@
 #include <dpl/abstract_waitable_input_adapter.h>
 #include <dpl/wrt-dao-ro/global_config.h>
 #include <task_commons.h>
+#include <sys/stat.h>
 
 using namespace WrtDB;
 
@@ -60,7 +61,6 @@ PathAndFilePair SplitFileAndPath(const std::string &filePath)
                                            position),
                            filePath.substr(position + 1));
 }
-
 }
 
 namespace Jobs {
@@ -102,15 +102,23 @@ void TaskUnzip::StepCreateTempPath()
 {
     // Step succedded, save temporary widget path
     m_installerContext.tempWidgetPath = createTempPath();
+    std::ostringstream path;
 
     if (m_installerContext.widgetConfig.pType == PKG_TYPE_TIZEN_WITHSVCAPP) {
         std::ostringstream tempRoot;
         tempRoot << m_installerContext.tempWidgetPath;
         tempRoot << "/" << GlobalConfig::GetWidgetSrcPath();
         m_installerContext.tempWidgetRoot = tempRoot.str();
+
+        path << GlobalConfig::GetUserInstalledWidgetPath() << "/";
+        path << m_installerContext.widgetConfig.pkgname;
     } else {
         m_installerContext.tempWidgetRoot = m_installerContext.tempWidgetPath;
+        path << GlobalConfig::GetUserInstalledWidgetPath() << "/";
+        path <<  m_installerContext.widgetConfig.pkgname << "/";
+        path << GlobalConfig::GetWidgetSrcPath();
     }
+    m_installerContext.installPath = path.str();
 
     m_installerContext.job->UpdateProgress(
         InstallerContext::INSTALL_CREATE_TEMPDIR,