#include <FIoDirectory.h>
#include <FIo_FileImpl.h>
#include <FBase_StringConverter.h>
-#include <FAppPkg_PackageManagerImpl.h>
#include <FAppPkg_PackageInfoImpl.h>
-#include <FAppPkg_PackageAppInfoImpl.h>
#include "InstallationContext.h"
#include "UninstallStep.h"
#include "InstallerUtil.h"
+#include "CompatibilityManager.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
// __pContext->__additionalErrorString = L"Thrown when the application cannot be uninstalled because the application was preloaded.";
// }
// TryReturn(isUninstallable == true, INSTALLER_ERROR_PACKAGE_INVALID, "preload app cannot be uninstalled.");
- String filePath = PATH_USR_APPS;
- filePath += L"/";
- filePath += __pContext->__packageId;
- if (File::IsFileExist(filePath) == true)
+
+ String rwXmlPath;
+ rwXmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, packageId.GetPointer());
+ if (File::IsFileExist(rwXmlPath) == false)
{
- AppLog("This is a preload app=[%ls]", filePath.GetPointer());
+ AppLog("This is a preload app = [%ls]", rwXmlPath.GetPointer());
__pContext->__isPreloaded = true;
}
__pContext->__rootPath = pPackageInfoImpl->GetAppRootPath();
-// if (__pContext->__rootPath.StartsWith(PATH_USR_APPS, 0) == true)
-// {
-// __pContext->__isPreloaded = true;
-// }
if (__pContext->__isHybridService == true)
{
AppLog("Uninstallation for HybridService");
- __state = STATE_DELETE_DIR;
+ __state = STATE_TERMINATE_APP;
return error;
}
}
delete pList;
- __state = STATE_DELETE_DIR;
+ __state = STATE_TERMINATE_APP;
return error;
}
{
InstallerError error = INSTALLER_ERROR_NONE;
+ InstallerUtil::TerminateApps(__pContext->__packageId);
+
GoNextState();
return error;
}
UninstallStep::OnStateRemoveDir(void)
{
InstallerError error = INSTALLER_ERROR_NONE;
+ bool res = true;
String rootPath;
rootPath = __pContext->__rootPath;
result r = GetLastResult();
if (r == E_SUCCESS && ospCompat == true)
{
- if (_FileImpl::FinalizeDataCaging(rootPath) == false)
+ if (CompatibilityManager::FinalizeDataCaging(rootPath) == false)
{
AppLog("[Tizen::Io] Failed to unmount directories for 2.0 application, appRootPath: %ls",
rootPath.GetPointer());
return INSTALLER_ERROR_UNMOUNT_FAILED;
}
+ CompatibilityManager::CleanDirectories(rootPath, __pContext->__packageId);
+
+ String virtualRoot = rootPath + DIR_VIRTUAL_ROOT;
+ if (File::IsFileExist(virtualRoot) == true)
+ {
+ res = CompatibilityManager::FinalizeVirtualRoot(rootPath, __pContext->__packageId);
+ TryReturn(res == true, INSTALLER_ERROR_UNMOUNT_FAILED, "CompatibilityManager::FinalizeVirtualRoot(%ls) failed.", rootPath.GetPointer());
+ }
+
AppLog("Directory::Remove - START");
if (__pContext->__isHybridService == true)