summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyunbin Lee <hyunbin.lee@samsung.com>2013-01-08 14:50:20 +0900
committerHyunbin Lee <hyunbin.lee@samsung.com>2013-01-08 14:50:48 +0900
commite9eb50b17b039be843f29991d250d82f16c5a26f (patch)
treeaed69e10d26c99ac860bbca098d4dfb551b6df20
parent5d4becdcd2e5d175cbb3ae9c647eefd4a1d85726 (diff)
downloadinstaller-e9eb50b17b039be843f29991d250d82f16c5a26f.tar.gz
installer-e9eb50b17b039be843f29991d250d82f16c5a26f.tar.bz2
installer-e9eb50b17b039be843f29991d250d82f16c5a26f.zip
Add unmount code for 2.0 applications.
Change-Id: I93ffc77e7c823251ed0debef53cbb9aab68d94f5 Signed-off-by: Hyunbin Lee <hyunbin.lee@samsung.com>
-rwxr-xr-xinc/InstallerDefs.h2
-rwxr-xr-xsrc/Step/UninstallStep.cpp25
2 files changed, 26 insertions, 1 deletions
diff --git a/inc/InstallerDefs.h b/inc/InstallerDefs.h
index 295e72c..f86f3ff 100755
--- a/inc/InstallerDefs.h
+++ b/inc/InstallerDefs.h
@@ -186,7 +186,7 @@ enum InstallerError
INSTALLER_ERROR_CERT_ROOT,
INSTALLER_ERROR_DRM,
INSTALLER_ERROR_INTEGRITY_FAILED,
-
+ INSTALLER_ERROR_UNMOUNT_FAILED
};
enum InstallerOperation
diff --git a/src/Step/UninstallStep.cpp b/src/Step/UninstallStep.cpp
index f3e6666..75bb455 100755
--- a/src/Step/UninstallStep.cpp
+++ b/src/Step/UninstallStep.cpp
@@ -215,6 +215,31 @@ UninstallStep::OnStateRemoveDir(void)
rootPath = pPackageInfoImpl->GetAppRootPath();
AppLogTag(OSP_INSTALLER, "rootPath[%ls]", rootPath.GetPointer());
+ String versionFile(rootPath);
+ versionFile.Append(L"/info/version.info");
+
+ File file;
+ result r = file.Construct(versionFile, "r");
+ TryReturn(r == E_SUCCESS || r == E_FILE_NOT_FOUND, INSTALLER_ERROR_UNMOUNT_FAILED, "Failed to open version.info");
+ if (r == E_SUCCESS)
+ {
+ //String apiVersion = pPackageInfoImpl->GetAppApiVersion();
+ //if (pPackageInfoImpl->GetAppApiVersion() == L"2.0")
+ String version;
+ r = file.Read(version);
+ TryReturn(r == E_SUCCESS, INSTALLER_ERROR_UNMOUNT_FAILED, "Failed to read version.info");
+
+ if (version.Contains(L"2.0"))
+ {
+ if (_FileImpl::FinalizeDataCaging(rootPath) == false)
+ {
+ AppLogTag(OSP_INSTALLER, "Failed to unmount directories for 2.0 application, appRootPath: %ls",
+ rootPath.GetPointer());
+ return INSTALLER_ERROR_UNMOUNT_FAILED;
+ }
+ }
+ }
+
AppLogTag(OSP_INSTALLER, "Directory::Remove - START");
if (__pContext->IsHybridService() == true)