diff options
author | Hyunbin Lee <hyunbin.lee@samsung.com> | 2013-01-08 14:50:20 +0900 |
---|---|---|
committer | Hyunbin Lee <hyunbin.lee@samsung.com> | 2013-01-08 14:50:48 +0900 |
commit | e9eb50b17b039be843f29991d250d82f16c5a26f (patch) | |
tree | aed69e10d26c99ac860bbca098d4dfb551b6df20 | |
parent | 5d4becdcd2e5d175cbb3ae9c647eefd4a1d85726 (diff) | |
download | installer-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-x | inc/InstallerDefs.h | 2 | ||||
-rwxr-xr-x | src/Step/UninstallStep.cpp | 25 |
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) |