#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;
std::unique_ptr< _PackageInfoImpl > pPackageInfoImpl(new (std::nothrow) _PackageInfoImpl());
TryReturn(pPackageInfoImpl, INSTALLER_ERROR_OUT_OF_MEMORY, "pPackageInfoImpl is null.");
- AppLog("packageId = %ls", packageId.GetPointer());
+ AppLog("package = %ls", packageId.GetPointer());
result r = pPackageInfoImpl->Construct(packageId);
TryReturn(r == E_SUCCESS, INSTALLER_ERROR_INTERNAL_STATE, "pPackageInfoImpl->Construct(%ls) failed.", packageId.GetPointer());
- __pContext->__rootPath = pPackageInfoImpl->GetAppRootPath();
- if (__pContext->__rootPath.StartsWith(PATH_USR_APPS, 0) == true)
+// bool isUninstallable = pPackageInfoImpl->IsUninstallable();
+// if (isUninstallable == false)
+// {
+// __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 rwXmlPath;
+ rwXmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, packageId.GetPointer());
+ if (File::IsFileExist(rwXmlPath) == false)
{
+ AppLog("This is a preload app = [%ls]", rwXmlPath.GetPointer());
__pContext->__isPreloaded = true;
}
+ __pContext->__rootPath = pPackageInfoImpl->GetAppRootPath();
+
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)