Implement reinstall mode
authorJihoon Chung <jihoon.chung@samsung.com>
Tue, 2 Apr 2013 08:14:22 +0000 (17:14 +0900)
committerGerrit Code Review <gerrit2@kim11>
Tue, 9 Apr 2013 14:06:29 +0000 (23:06 +0900)
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution] Implement reinstall mode
This option support RDS mode with new path "/opt/usr/apps/tmp/<pkgid>"
Read .rds_delta file and update web application
Test command is wrt-installer -r option
[SCMRequest] N/A

Change-Id: If4678cbde39643f84fd9519d8e4579eab406d37a

14 files changed:
src/CMakeLists.txt
src/jobs/widget_install/job_widget_install.cpp
src/jobs/widget_install/job_widget_install.h
src/jobs/widget_install/task_prepare_reinstall.cpp [new file with mode: 0644]
src/jobs/widget_install/task_prepare_reinstall.h [new file with mode: 0644]
src/jobs/widget_install/widget_install_context.h
src/jobs/widget_install/widget_install_errors.h
src/jobs/widget_install/widget_installer_struct.h
src/misc/widget_location.cpp
src/misc/widget_location.h
src/pkg-manager/pkgmgr_signal.cpp
src/wrt-installer/wrt-installer.cpp
src/wrt-installer/wrt_installer_api.cpp
src/wrt-installer/wrt_installer_api.h

index aabab61..94f836c 100644 (file)
@@ -79,6 +79,7 @@ SET(INSTALLER_SOURCES
     ${INSTALLER_JOBS}/widget_install/task_encrypt_resource.cpp
     ${INSTALLER_JOBS}/widget_install/task_plugins_copy.cpp
     ${INSTALLER_JOBS}/widget_install/task_certificates.cpp
+    ${INSTALLER_JOBS}/widget_install/task_prepare_reinstall.cpp
     ${INSTALLER_JOBS}/widget_install/wac_security.cpp
     ${INSTALLER_JOBS}/widget_install/widget_update_info.cpp
     ${INSTALLER_JOBS}/widget_install/widget_install_popup.cpp
index 692b458..8579e9a 100644 (file)
@@ -69,8 +69,8 @@
 #include <widget_install/task_certificates.h>
 #include <widget_install/task_unzip.h>
 #include <widget_install/task_commons.h>
-
 #include <widget_install/task_plugins_copy.h>
+#include <widget_install/task_prepare_reinstall.h>
 
 #include <widget_install/widget_install_errors.h>
 #include <widget_install/widget_install_context.h>
@@ -216,6 +216,13 @@ JobWidgetInstall::JobWidgetInstall(
         LogInfo("Configure installation updated");
         LogInfo("Widget Update");
         m_installerContext.job->SetProgressFlag(true);
+
+        if (m_jobStruct.m_installMode ==
+            InstallMode::REINSTALL_MODE_DIRECTORY)
+        {
+            AddTask(new TaskPrepareReinstall(m_installerContext));
+        }
+
         if (m_installerContext.widgetConfig.packagingType !=
             WrtDB::PKG_TYPE_HOSTED_WEB_APP &&
             m_installerContext.widgetConfig.packagingType !=
@@ -288,8 +295,22 @@ ConfigureResult JobWidgetInstall::PrePareInstallation(
 
     Try
     {
-        std::string tempDir =
-            Jobs::WidgetInstall::createTempPath(m_jobStruct.m_installMode == InstallMode::INSTALL_MODE_PRELOAD);
+        std::string tempDir;
+        if (m_jobStruct.m_installMode ==
+            InstallMode::REINSTALL_MODE_DIRECTORY)
+        {
+            std::ostringstream tempPathBuilder;
+            tempPathBuilder << WrtDB::GlobalConfig::GetUserInstalledWidgetPath();
+            tempPathBuilder << WrtDB::GlobalConfig::GetTmpDirPath();
+            tempPathBuilder << "/";
+            tempPathBuilder << widgetPath;
+            tempDir = tempPathBuilder.str();;
+        } else {
+            tempDir =
+                Jobs::WidgetInstall::createTempPath(
+                        m_jobStruct.m_installMode ==
+                            InstallMode::INSTALL_MODE_PRELOAD);
+        }
 
         m_isDRM = isDRMWidget(widgetPath);
         if (true == m_isDRM) {
@@ -308,7 +329,9 @@ ConfigureResult JobWidgetInstall::PrePareInstallation(
                 widgetPath,
                 tempDir,
                 m_installerContext.widgetConfig.packagingType,
-                m_isDRM);
+                m_isDRM,
+                m_jobStruct.m_installMode ==
+                    InstallMode::REINSTALL_MODE_DIRECTORY);
         LogDebug("widget packaging type : " <<
                  m_installerContext.widgetConfig.packagingType.pkgType);
 
@@ -436,12 +459,24 @@ void JobWidgetInstall::setTizenId(
 void JobWidgetInstall::configureWidgetLocation(const std::string & widgetPath,
                                                const std::string& tempPath)
 {
-    m_installerContext.locations =
-        WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig.
-                                             tzPkgid),
-                       widgetPath, tempPath,
-                       m_installerContext.widgetConfig.packagingType,
-                       m_installerContext.locationType);
+    if (m_jobStruct.m_installMode ==
+         InstallMode::REINSTALL_MODE_DIRECTORY)
+    {
+        // replace widget path to installed path
+        m_installerContext.locations =
+            WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig.
+                                                 tzPkgid),
+                           widgetPath, tempPath,
+                           m_installerContext.widgetConfig.packagingType,
+                           m_installerContext.locationType);
+    } else {
+        m_installerContext.locations =
+            WidgetLocation(DPL::ToUTF8String(m_installerContext.widgetConfig.
+                                                 tzPkgid),
+                           widgetPath, tempPath,
+                           m_installerContext.widgetConfig.packagingType,
+                           m_installerContext.locationType);
+    }
     m_installerContext.locations->registerAppid(
         DPL::ToUTF8String(m_installerContext.widgetConfig.tzAppid));
 
@@ -563,7 +598,8 @@ ConfigureResult JobWidgetInstall::checkWidgetUpdate(
     m_installerContext.widgetConfig.tzAppid = update.tzAppId;
 
     if (isUpperVersion(update.existingVersion, update.incomingVersion) ||
-        m_jobStruct.m_installMode == InstallMode::INSTALL_MODE_DIRECTORY)
+        (m_jobStruct.m_installMode == InstallMode::INSTALL_MODE_DIRECTORY) ||
+        (m_jobStruct.m_installMode == InstallMode::REINSTALL_MODE_DIRECTORY))
     {
         LogInfo("Whether widget policy allow proceed ok");
         return ConfigureResult::Updated;
@@ -606,7 +642,8 @@ ConfigParserData JobWidgetInstall::getWidgetDataFromXML(
     const std::string &widgetSource,
     const std::string &tempPath,
     WrtDB::PackagingType pkgType,
-    bool isDRM)
+    bool isDRM,
+    bool isReinstall)
 {
     // Parse config
     ParserRunner parser;
@@ -621,7 +658,23 @@ ConfigParserData JobWidgetInstall::getWidgetDataFromXML(
                                                           DPL::FromUTF32String(
                                                               L"widget"))));
         } else if (pkgType == PKG_TYPE_DIRECTORY_WEB_APP) {
-            parser.Parse(widgetSource + '/' + WITH_OSP_XML,
+            std::string configPath;
+            configPath = tempPath;
+            configPath += "/";
+            configPath += WITH_OSP_XML;
+
+            if (isReinstall) {
+                // checking RDS data directory
+                if (access(configPath.c_str(), F_OK) != 0) {
+                    std::string tzAppId =
+                        widgetSource.substr(widgetSource.find_last_of("/")+1);
+                    WidgetDAOReadOnly dao(WidgetDAOReadOnly::getTzAppId(DPL::FromUTF8String(tzAppId)));
+                    configPath = DPL::ToUTF8String(*dao.getWidgetInstalledPath());
+                    configPath += "/";
+                    configPath += WITH_OSP_XML;
+                }
+            }
+            parser.Parse(configPath,
                          ElementParserPtr(
                              new RootParser<WidgetParser>(
                                  configInfo,
@@ -891,7 +944,8 @@ WrtDB::PackagingType JobWidgetInstall::checkPackageType(
     const std::string &tempPath)
 {
     // Check installation type (direcotory/ or config.xml or widget.wgt)
-    if (m_jobStruct.m_installMode == InstallMode::INSTALL_MODE_DIRECTORY)
+    if (m_jobStruct.m_installMode == InstallMode::INSTALL_MODE_DIRECTORY ||
+         m_jobStruct.m_installMode == InstallMode::REINSTALL_MODE_DIRECTORY)
     {
         LogDebug("Install directly from directory");
         return PKG_TYPE_DIRECTORY_WEB_APP;
index 004a476..f0af6f2 100644 (file)
@@ -74,7 +74,8 @@ class JobWidgetInstall :
         const std::string &widgetSource,
         const std::string &tempPath,
         WrtDB::PackagingType pkgType,
-        bool isDRM);
+        bool isDRM,
+        bool isReinstall);
     static WidgetUpdateInfo detectWidgetUpdate(
         const WrtDB::ConfigParserData &configInfo,
         const WrtDB::TizenAppId &tizenId);
diff --git a/src/jobs/widget_install/task_prepare_reinstall.cpp b/src/jobs/widget_install/task_prepare_reinstall.cpp
new file mode 100644 (file)
index 0000000..0e6bdc4
--- /dev/null
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/**
+ * @file    task_prepare_reinstall.cpp
+ * @author  Jihoon Chung(jihoon.chung@samsung.com)
+ * @version 1.0
+ * @brief   Implementation file for installer task prepare reinstalling
+ */
+
+#include "task_prepare_reinstall.h"
+
+#include <stdio.h>
+#include <fstream>
+
+#include <dpl/task.h>
+#include <dpl/string.h>
+#include <dpl/log/log.h>
+#include <dpl/foreach.h>
+
+#include <widget_install/widget_install_context.h>
+#include <widget_install/widget_install_errors.h>
+#include <widget_install/job_widget_install.h>
+
+namespace Jobs {
+namespace WidgetInstall {
+namespace {
+const char* const KEY_DELETE = "#delete";
+const char* const KEY_ADD = "#add";
+const char* const KEY_MODIFY = "#modify";
+std::list<std::string> keyList = {KEY_DELETE, KEY_ADD, KEY_MODIFY};
+
+void verifyFile(const std::string &filePath)
+{
+    if (access(filePath.c_str(), F_OK) != 0) {
+        ThrowMsg(Exceptions::AceCheckFailed, "File is missed " << filePath);
+    }
+}
+}
+
+TaskPrepareReinstall::TaskPrepareReinstall(InstallerContext& context) :
+    DPL::TaskDecl<TaskPrepareReinstall>(this),
+    m_context(context)
+{
+    AddStep(&TaskPrepareReinstall::StepPrepare);
+    AddStep(&TaskPrepareReinstall::StepParseRDSDelta);
+    AddStep(&TaskPrepareReinstall::StepVerifyRDSDelta);
+    AddStep(&TaskPrepareReinstall::StepAddFile);
+    AddStep(&TaskPrepareReinstall::StepDeleteFile);
+    AddStep(&TaskPrepareReinstall::StepModifyFile);
+}
+
+void TaskPrepareReinstall::StepPrepare()
+{
+    LogInfo("Prepare");
+    m_sourcePath = m_context.locations->getTemporaryPackageDir();
+    m_sourcePath += "/";
+
+    m_installedPath = m_context.locations->getPackageInstallationDir();
+    m_installedPath += "/";
+}
+
+void TaskPrepareReinstall::StepParseRDSDelta()
+{
+    LogInfo("parse RDS delta");
+    std::string rdsDeltaPath = m_sourcePath;
+    rdsDeltaPath += ".rds_delta";
+    std::ifstream delta(rdsDeltaPath);
+
+    if (!delta.is_open()) {
+        // TODO throw exception
+        ThrowMsg(Exceptions::RDSDeltaFailure, "rds_delta file is missed");
+        return;
+    }
+
+    std::string line;
+    std::string key;
+    while (std::getline(delta, line) &&!delta.eof()) {
+        FOREACH(keyIt, keyList) {
+            if (line == *keyIt) {
+                LogInfo("find key = [" << line << "]");
+                key = line;
+                break;
+            }
+        }
+        if (key == line || line.empty() || line == "\n") {
+            continue;
+        }
+        if (key == KEY_DELETE) {
+            m_deleteFileList.push_back(line);
+            LogInfo("line = [" << line << "]");
+        } else if (key == KEY_ADD) {
+            m_addFileList.push_back(line);
+            LogInfo("line = [" << line << "]");
+        } else if (key == KEY_MODIFY) {
+            m_modifyFileList.push_back(line);
+            LogInfo("line = [" << line << "]");
+        }
+    }
+}
+
+void TaskPrepareReinstall::StepVerifyRDSDelta()
+{
+    LogInfo("verify RDS delta");
+    // Verify ADD file
+    FOREACH(file, m_addFileList) {
+        std::string addFilePath = m_sourcePath;
+        addFilePath += *file;
+        verifyFile(addFilePath);
+    }
+    // Verify DELETE file
+    FOREACH(file, m_deleteFileList) {
+        std::string deleteFilePath = m_installedPath;
+        deleteFilePath += *file;
+        verifyFile(deleteFilePath);
+    }
+    // Verify MODIFY file
+    FOREACH(file, m_modifyFileList) {
+        std::string newFilePath = m_sourcePath;
+        newFilePath += *file;
+        verifyFile(newFilePath);
+
+        std::string existingFilePath = m_installedPath;
+        existingFilePath += *file;
+        verifyFile(existingFilePath);
+    }
+    LogInfo("Finished veify RDS Delta");
+
+    m_context.job->UpdateProgress(
+        InstallerContext::INSTALL_RDS_DELTA_CHECK,
+        "RDS delta verify finished");
+}
+
+void TaskPrepareReinstall::StepAddFile()
+{
+    LogInfo("Add file");
+    FOREACH(file, m_addFileList) {
+        std::string newfile = m_sourcePath;
+        newfile += *file;
+        std::string destPath = m_installedPath;
+        destPath += *file;
+        if (rename(newfile.c_str(), destPath.c_str()) != 0) {
+            ThrowMsg(Exceptions::RDSDeltaFailure,
+                "Fail to ADD file " << newfile);
+        }
+        LogInfo("Copy " << newfile << " to " << destPath);
+    }
+}
+
+void TaskPrepareReinstall::StepDeleteFile()
+{
+    LogInfo("Delete file");
+    FOREACH(file, m_deleteFileList) {
+        std::string deleteFilePath = m_installedPath;
+        deleteFilePath += *file;
+        if (remove(deleteFilePath.c_str()) != 0) {
+            ThrowMsg(Exceptions::RDSDeltaFailure,
+                "Fail to DELETE file " << deleteFilePath);
+        }
+        LogInfo("Delete " << deleteFilePath);
+    }
+}
+
+void TaskPrepareReinstall::StepModifyFile()
+{
+    LogInfo("Modify  file");
+    FOREACH(file, m_modifyFileList) {
+        std::string destPath = m_installedPath;
+        destPath += *file;
+        if (remove(destPath.c_str()) != 0) {
+            ThrowMsg(Exceptions::RDSDeltaFailure,
+                "Fail to delete existing file " << destPath);
+        }
+
+        std::string newfile = m_sourcePath;
+        newfile += *file;
+        if (rename(newfile.c_str(), destPath.c_str()) != 0) {
+            ThrowMsg(Exceptions::RDSDeltaFailure,
+                "Fail to move new file" << destPath);
+        }
+        LogInfo("Replace " << newfile << " to " << destPath);
+    }
+    m_context.job->UpdateProgress(
+        InstallerContext::INSTALL_RDS_PREPARE,
+        "RDS prepare finished");
+}
+
+} //namespace WidgetInstall
+} //namespace Jobs
diff --git a/src/jobs/widget_install/task_prepare_reinstall.h b/src/jobs/widget_install/task_prepare_reinstall.h
new file mode 100644 (file)
index 0000000..1104e15
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+/*
+ * @file    task_prepare_reinstall.h
+ * @author  Jihoon Chung(jihoon.chung@samsung.com)
+ * @version 1.0
+ * @brief   Header file for installer task prepare reinstalling
+ */
+#ifndef INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_PREPARE_REINSTALL_H
+#define INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_PREPARE_REINSTALL_H
+
+#include <list>
+#include <dpl/task.h>
+
+#include <widget_install/widget_install_context.h>
+
+class InstallerContext;
+
+namespace Jobs {
+namespace WidgetInstall {
+class TaskPrepareReinstall :
+    public DPL::TaskDecl<TaskPrepareReinstall>
+{
+  public:
+    TaskPrepareReinstall(InstallerContext& context);
+
+  private:
+    // install internal location
+    void StepPrepare();
+    void StepParseRDSDelta();
+    void StepVerifyRDSDelta();
+    void StepAddFile();
+    void StepDeleteFile();
+    void StepModifyFile();
+
+    void StepAbortPrepareReinstall();
+
+    InstallerContext& m_context;
+    // TODO : replace multimap
+    std::list<std::string> m_addFileList;
+    std::list<std::string> m_deleteFileList;
+    std::list<std::string> m_modifyFileList;
+    std::string m_sourcePath;
+    std::string m_installedPath;
+};
+} //namespace WidgetInstall
+} //namespace Jobs
+
+#endif // INSTALLER_CORE_JOS_WIDGET_INSTALL_TASK_PREPARE_REINSTALL_H
index b7b2bfe..069cf1b 100644 (file)
@@ -47,6 +47,10 @@ struct InstallerContext
     {
         INSTALL_START = 0,
         INSTALL_CHECK_FILE,
+
+        INSTALL_RDS_DELTA_CHECK,
+        INSTALL_RDS_PREPARE,
+
         INSTALL_UNZIP_FILES,
         INSTALL_WIDGET_CONFIG1,
         INSTALL_WIDGET_CONFIG2,
index 8d4dcd8..6464504 100644 (file)
@@ -42,6 +42,7 @@ DECLARE_JOB_EXCEPTION(Base, ZipEmpty, ErrorPackageInvalid)
 DECLARE_JOB_EXCEPTION(Base, ExtractFileFailed, ErrorPackageInvalid)
 DECLARE_JOB_EXCEPTION(Base, EmptyPluginsDirectory, ErrorPackageInvalid)
 DECLARE_JOB_EXCEPTION(Base, PluginsSubdirectory, ErrorPackageInvalid)
+DECLARE_JOB_EXCEPTION(Base, RDSDeltaFailure, ErrorPackageInvalid)
 
 DECLARE_JOB_EXCEPTION(Base, PackageLowerVersion, ErrorPackageLowerVersion)
 
index e43b791..608cf44 100644 (file)
@@ -51,6 +51,7 @@ enum Type
     INSTALL_MODE_WGT = 0,
     INSTALL_MODE_DIRECTORY,
     INSTALL_MODE_PRELOAD,
+    REINSTALL_MODE_DIRECTORY
 };
 }
 
index d6fff67..8a080da 100644 (file)
@@ -28,8 +28,8 @@
 
 #include <widget_install/task_commons.h>
 
-WidgetLocation::DirectoryDeletor::DirectoryDeletor() :
-    m_dirpath(Jobs::WidgetInstall::createTempPath())
+WidgetLocation::DirectoryDeletor::DirectoryDeletor(bool isPreload) :
+    m_dirpath(Jobs::WidgetInstall::createTempPath(isPreload))
 {}
 
 WidgetLocation::DirectoryDeletor::DirectoryDeletor(std::string tempPath) :
@@ -67,13 +67,19 @@ WidgetLocation::WidgetLocation(const std::string & widgetname,
     m_pkgid(widgetname),
     m_widgetSource(sourcePath),
     m_type(t),
-    m_temp(new WidgetLocation::DirectoryDeletor())
+    m_temp(
+        new WidgetLocation::DirectoryDeletor(
+            INSTALL_LOCATION_TYPE_PRELOAD == locationType))
 {
     if (INSTALL_LOCATION_TYPE_PRELOAD == locationType) {
         m_installedPath += WrtDB::GlobalConfig::GetUserPreloadedWidgetPath();
     } else {
         m_installedPath += WrtDB::GlobalConfig::GetUserInstalledWidgetPath();
     }
+    // TODO clean-up
+    if (access(m_widgetSource.c_str(), F_OK) != 0) {
+        m_widgetSource = m_installedPath + "/" + m_pkgid;
+    }
 }
 
 WidgetLocation::WidgetLocation(const std::string & widgetname,
@@ -92,6 +98,10 @@ WidgetLocation::WidgetLocation(const std::string & widgetname,
     } else {
         m_installedPath += WrtDB::GlobalConfig::GetUserInstalledWidgetPath();
     }
+    // TODO clean-up
+    if (access(m_widgetSource.c_str(), F_OK) != 0) {
+        m_widgetSource = m_installedPath + "/" + m_pkgid;
+    }
 }
 
 // TODO cache all these paths
index 70c186a..ad240ac 100644 (file)
@@ -62,6 +62,8 @@ class WidgetLocation
       public:
         DirectoryDeletor();
         DirectoryDeletor(std::string tempPath);
+        DirectoryDeletor(bool isPreload);
+
         ~DirectoryDeletor();
         std::string getTempPath() const;
 
index 1732b27..b4a8e3e 100644 (file)
@@ -55,7 +55,8 @@ bool PkgmgrSignal::initialize(int argc, char* argv[])
         m_noPopup = pkgmgr_installer_is_quiet(m_handle);
         m_reqType = pkgmgr_installer_get_request_type(m_handle);
         if (m_reqType != PKGMGR_REQ_INSTALL &&
-            m_reqType != PKGMGR_REQ_UNINSTALL)
+            m_reqType != PKGMGR_REQ_UNINSTALL &&
+            m_reqType != PKGMGR_REQ_REINSTALL)
         {
             LogError("Fail to get request type of pkgmgr");
             pkgmgr_installer_free(m_handle);
index 1a1a427..1184580 100644 (file)
@@ -289,6 +289,14 @@ void WrtInstaller::OnCreate()
             }
             m_packagePath = m_argv[2];
             AddStep(&WrtInstaller::unistallWgtFileStep);
+        } else if (arg == "-r" || arg == "--reinstall") {
+            if (m_argc != 3) {
+                return showHelpAndQuit();
+            }
+            LogInfo("Installing package directly from directory");
+            m_installMode = WRT_INSTALL_MODE_REINSTALL;
+            m_packagePath = m_argv[2];
+            AddStep(&WrtInstaller::installStep);
         } else {
             return showHelpAndQuit();
         }
@@ -326,6 +334,11 @@ void WrtInstaller::OnCreate()
             m_name = m_argv[4];
             AddStep(&WrtInstaller::uninstallPkgNameStep);
             break;
+        case PKGMGR_REQ_REINSTALL:
+            m_packagePath = m_argv[4];
+            m_installMode = WRT_INSTALL_MODE_REINSTALL;
+            AddStep(&WrtInstaller::installStep);
+            break;
         default:
             LogDebug("Not available type");
             break;
@@ -371,6 +384,8 @@ void WrtInstaller::showHelpAndQuit()
            "uninstall widget for given package name\n"
            "  -up,   --uninstall-packagepath                "
            "uninstall widget for given package file path\n"
+           "  -r,    --reinstall                            "
+           "reinstall web application\n"
            "\n");
 
     Quit();
index d6d34d8..92f16c6 100644 (file)
@@ -63,6 +63,8 @@ inline InstallMode::Type translateInstallMode(
         return InstallMode::INSTALL_MODE_DIRECTORY;
     } else if (WRT_INSTALL_MODE_INSTALL_PRELOAD == installMode) {
         return InstallMode::INSTALL_MODE_PRELOAD;
+    } else if (WRT_INSTALL_MODE_REINSTALL == installMode) {
+        return InstallMode::REINSTALL_MODE_DIRECTORY;
     }
     Assert(true && "wrong argument is inputed");
 }
index 584e529..bb4ff8d 100644 (file)
@@ -50,7 +50,8 @@ enum WrtInstallMode
     WRT_INSTALL_MODE_UNKNOWN = 0,
     WRT_INSTALL_MODE_INSTALL_WGT,
     WRT_INSTALL_MODE_INSTALL_DIRECTORY,
-    WRT_INSTALL_MODE_INSTALL_PRELOAD
+    WRT_INSTALL_MODE_INSTALL_PRELOAD,
+    WRT_INSTALL_MODE_REINSTALL
 };
 
 void wrt_installer_init(