#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130828.1]"
+#define OSP_INSTALLER_VERSION "version=[20130828.2]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
rootPath += packageId;
backupPath = rootPath + BACKUP_NAME_RULE;
+ TryReturn(File::IsFileExist(backupPath) == true, false, "backupPath[%ls] is not found.", backupPath.GetPointer());
// data
srcPath = backupPath + DIR_DATA;
#include "InstallationContext.h"
#include "SystemCheckStep.h"
-#include "ConfigurationManager.h"
#include "DatabaseManager.h"
using namespace Tizen::App;
using namespace Tizen::Base::Collection;
SystemCheckStep::SystemCheckStep(void)
-:__state(STATE_POLICY_CHECK)
+:__state(STATE_VERSION_CHECK)
,__pContext(null)
{
}
{
switch (__state)
{
- case STATE_POLICY_CHECK:
- error = OnStatePolicyCheck();
- break;
-
case STATE_VERSION_CHECK:
error = OnStateVersionCheck();
break;
- case STATE_BACKUP:
- error = OnStateBackup();
- break;
-
case STATE_DONE:
error = OnStateDone();
break;
}
InstallerError
-SystemCheckStep::OnStatePolicyCheck(void)
-{
- InstallerError error = INSTALLER_ERROR_NONE;
-
- GoNextState();
- return error;
-}
-
-InstallerError
SystemCheckStep::OnStateVersionCheck(void)
{
InstallerError error = INSTALLER_ERROR_NONE;
}
InstallerError
-SystemCheckStep::OnStateBackup(void)
-{
- InstallerError error = INSTALLER_ERROR_NONE;
-
- if ((__pContext->__isUpdated == true) && (__pContext->__isPreloaded == false))
- {
- ConfigurationManager configurationManager;
- bool res = configurationManager.CreateBackup(__pContext);
- TryReturn(res == true, INSTALLER_ERROR_BACKUP_FAILED, "configurationManager.CreateBackup(%ls) failed.", __pContext->__packageId.GetPointer());
- }
-
- GoNextState();
- return error;
-}
-
-InstallerError
SystemCheckStep::OnStateDone(void)
{
InstallerError error = INSTALLER_ERROR_NONE;
private:
enum
{
- STATE_POLICY_CHECK,
STATE_VERSION_CHECK,
- STATE_BACKUP,
STATE_DONE
};
};
void GoNextState(void);
- InstallerError OnStatePolicyCheck(void);
InstallerError OnStateVersionCheck(void);
- InstallerError OnStateBackup(void);
InstallerError OnStateDone(void);
int CompareVersion(const Tizen::Base::String& oldVersion, const Tizen::Base::String& newVersion);
#include "InstallationContext.h"
#include "UnpackStep.h"
#include "InstallerUtil.h"
+#include "ConfigurationManager.h"
using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Io;
UnpackStep::UnpackStep(void)
-:__state(STATE_UNZIP)
+:__state(STATE_BACKUP)
,__pContext(null)
,__pDirectoryList(null)
,__uncompressedSize(0)
{
switch (__state)
{
+ case STATE_BACKUP:
+ AppLog("[STATE_BACKUP]");
+ error = OnStateBackup();
+ break;
+
case STATE_UNZIP:
AppLog("[STATE_UNZIP]");
error = OnUnzip();
}
InstallerError
+UnpackStep::OnStateBackup(void)
+{
+ InstallerError error = INSTALLER_ERROR_NONE;
+
+ if ((__pContext->__isUpdated == true) && (__pContext->__isPreloaded == false))
+ {
+ ConfigurationManager configurationManager;
+ bool res = configurationManager.CreateBackup(__pContext);
+ TryReturn(res == true, INSTALLER_ERROR_BACKUP_FAILED, "configurationManager.CreateBackup(%ls) failed.", __pContext->__packageId.GetPointer());
+ }
+
+ GoNextState();
+ return error;
+}
+
+InstallerError
UnpackStep::OnUnzip(void)
{
InstallerError error = INSTALLER_ERROR_NONE;
private:
enum
{
+ STATE_BACKUP,
STATE_UNZIP,
STATE_FILE_MOVE,
STATE_CREATE_DIR,
};
void GoNextState(void);
+ InstallerError OnStateBackup(void);
InstallerError OnUnzip(void);
InstallerError OnStateFileMove(void);
InstallerError OnCreateDir(void);