#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130525.1]"
+#define OSP_INSTALLER_VERSION "version=[20130527.1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
enum InstallationStorage
{
+ INSTALLATION_STORAGE_NONE,
INSTALLATION_STORAGE_INTERNAL,
INSTALLATION_STORAGE_EXTERNAL,
,__isCsc(false)
,__isUninstallable(false)
,__operation(INSTALLER_OPERATION_INSTALL)
-,__storage(INSTALLATION_STORAGE_INTERNAL)
+,__storage(INSTALLATION_STORAGE_NONE)
,__rootCertType(ROOT_CERTIFICATE_NONE)
,__privilegeLevel(PRIVILEGE_LEVEL_PUBLIC)
,__pApp2ExtHandle(null)
DirEntry entry = pDirEnum->GetCurrentDirEntry();
String entryName = entry.GetName();
- //String rootDirectory = rootPath;
- //rootDirectory += L"/";
- //rootDirectory += entryName;
if (entryName == L"." || entryName == L"..")
{
pDirDetails->name = (char*) calloc(1, (sizeof(char) * length) + 1);
snprintf(pDirDetails->name, length + 1, "%ls", entryName.GetPointer());
- String bin(L"bin");
- String res(L"res");
- String icons(L"icons");
+ String data(L"data");
+ String shared(L"shared");
- if (entryName.Contains(bin) || entryName.Contains(res) || entryName.Contains(icons))
+ if (entryName.Contains(data) || entryName.Contains(shared))
{
- pDirDetails->type = APP2EXT_DIR_RO;
+ pDirDetails->type = APP2EXT_DIR_RW;
}
else
{
- pDirDetails->type = APP2EXT_DIR_RW;
+ pDirDetails->type = APP2EXT_DIR_RO;
}
AppLog("------------------------------------------");
{
InstallerError error = INSTALLER_ERROR_NONE;
int res = 0;
+ bool result = true;
std::unique_ptr< PackageInfo > pPackageInfo(_PackageManagerImpl::GetInstance()->GetPackageInfoN(__pContext->__packageId));
if (pPackageInfo)
AppLog("AutoRestart[%ls] is updated.", pAppInfoImpl->GetAppFeature(key).GetPointer());
}
- res = CheckAppStatus(appId);
- TryReturn(res, INSTALLER_ERROR_FATAL_ERROR, "CheckAppStatus(%ls) failed.", appId.GetPointer());
+ result = InstallerUtil::TerminateApp(appId);
+ TryReturn(result == true, INSTALLER_ERROR_FATAL_ERROR, "TerminateApp(%ls) failed.", appId.GetPointer());
}
}
return true;
}
-
-bool
-SystemCheckStep::CheckAppStatus(const AppId& appId)
-{
- bool res = true;
-
- if (_Aul::IsRunning(appId) == true)
- {
- AppLog("App(%ls) is running.", appId.GetPointer());
-
- result r = _Aul::TerminateApplication(appId);
- TryReturn(r == E_SUCCESS, false, "TerminateApplication() failed. [%ls]", appId.GetPointer());
-
- for (int j = 0; j < TERMINATE_RETRY_COUNT; j++)
- {
- res = _Aul::IsRunning(appId);
- if (res == false)
- {
- AppLog("App(%ls) is terminated.", appId.GetPointer());
- break;
- }
- else
- {
- AppLog("App(%ls) is not terminated yet. wait count = [%d]", appId.GetPointer(), j);
- usleep(100000);
- }
- }
-
- if (res == true)
- {
- AppLog("App(%ls) can't be terminated.", appId.GetPointer());
- return false;
- }
- }
- else
- {
- AppLog("App(%ls) is not running.", appId.GetPointer());
- }
-
- return true;
-}
int CompareVersion(const Tizen::Base::String& oldVersion, const Tizen::Base::String& newVersion);
bool ExtractVersion(const Tizen::Base::String& version, int& major, int& minor, int& macro);
- bool CheckAppStatus(const Tizen::App::AppId& appId);
private:
int __state;
#include <app2ext_interface.h>
#include <FIoDirectory.h>
-#include <FAppPkgPackageInfo.h>
-#include <FAppPkgPackageAppInfo.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"
UninstallStep::OnStateTerminateApp(void)
{
InstallerError error = INSTALLER_ERROR_NONE;
- std::unique_ptr< PackageInfo > pPackageInfo(_PackageManagerImpl::GetInstance()->GetPackageInfoN(__pContext->__packageId));
- _PackageInfoImpl* pPackageInfoImpl = _PackageInfoImpl::GetInstance(pPackageInfo.get());
- TryReturn(pPackageInfoImpl, INSTALLER_ERROR_INTERNAL_STATE, "GetInstance() failed.");
-
- std::unique_ptr< IList > pPackageAppList(pPackageInfoImpl->GetPackageAppInfoListN());
- TryReturn(pPackageAppList, INSTALLER_ERROR_INTERNAL_STATE, "GetPackageAppInfoListN() failed.");
-
- for (int i = 0; i < pPackageAppList->GetCount(); i++)
- {
- PackageAppInfo* pPackageAppInfo = dynamic_cast < PackageAppInfo* >(pPackageAppList->GetAt(i));
- TryReturn(pPackageAppInfo, INSTALLER_ERROR_INTERNAL_STATE, "pPackageAppList->GetAt(%d) failed.", i);
-
- AppId appId = pPackageAppInfo->GetAppId();
- InstallerUtil::TerminateApp(appId);
- }
+ InstallerUtil::TerminateApps(__pContext->__packageId);
GoNextState();
return error;
#include <FBaseErrorDefine.h>
#include <FIoFile.h>
#include <FIoDirectory.h>
+#include <FAppPkgPackageAppInfo.h>
+#include <FAppPkgPackageInfo.h>
#include <FBase_StringConverter.h>
#include <FSecCryptoSha2Hash.h>
#include <FApp_Aul.h>
+#include <FAppPkg_PackageManagerImpl.h>
+#include <FAppPkg_PackageInfoImpl.h>
+#include <FAppPkg_PackageAppInfoImpl.h>
#include "InstallerDefs.h"
#include "InstallerUtil.h"
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
using namespace Tizen::App;
+using namespace Tizen::App::Package;
using namespace Tizen::Io;
using namespace Tizen::Security::Crypto;
return true;
}
+bool
+InstallerUtil::TerminateApps(const PackageId& packageId)
+{
+ std::unique_ptr< PackageInfo > pPackageInfo(_PackageManagerImpl::GetInstance()->GetPackageInfoN(packageId));
+
+ _PackageInfoImpl* pPackageInfoImpl = _PackageInfoImpl::GetInstance(pPackageInfo.get());
+ TryReturn(pPackageInfoImpl, false, "GetInstance() failed.");
+
+ std::unique_ptr< IList > pPackageAppList(pPackageInfoImpl->GetPackageAppInfoListN());
+ TryReturn(pPackageAppList, false, "GetPackageAppInfoListN() failed.");
+
+ for (int i = 0; i < pPackageAppList->GetCount(); i++)
+ {
+ PackageAppInfo* pPackageAppInfo = dynamic_cast < PackageAppInfo* >(pPackageAppList->GetAt(i));
+ TryReturn(pPackageAppInfo, false, "pPackageAppList->GetAt(%d) failed.", i);
+
+ AppId appId = pPackageAppInfo->GetAppId();
+ TerminateApp(appId);
+ }
+
+ return true;
+}
static Tizen::Base::Collection::IMap* ParseN(const Tizen::Base::String& str, const Tizen::Base::String& tokenDelimiter);
static bool TerminateApp(const Tizen::App::AppId& appId);
+ static bool TerminateApps(const Tizen::App::PackageId& packageId);
private:
static char LogChangeHexToStr(int hex);
String location;
String appSetting(L"false");
- if (__pContext->__isPreloaded == true)
+ if ((__pContext->__isPreloaded == true) || (__pContext->__storage == INSTALLATION_STORAGE_INTERNAL))
{
location = L"internal-only";
}
AppLog("</ServiceApp>");
+ AppLog("INSTALLATION_STORAGE = [INTERNAL]");
+ __isInternalStorage = true;
+
return true;
}
{
AppLog("</Apps>");
- if ((__isInternalStorage == false) && (File::IsFileExist(DIR_MEMORYCARD_INSTALLATION) == true))
+ if (__isInternalStorage == true)
+ {
+ AppLog("INSTALLATION_STORAGE = [INTERNAL]");
+ __pContext->__storage = INSTALLATION_STORAGE_INTERNAL;
+ }
+ else
{
- AppLog("INSTALLATION_STORAGE = [EXTERNAL]");
- __pContext->__storage = INSTALLATION_STORAGE_EXTERNAL;
+ if (File::IsFileExist(DIR_MEMORYCARD_INSTALLATION) == true)
+ {
+ AppLog("INSTALLATION_STORAGE = [EXTERNAL]");
+ __pContext->__storage = INSTALLATION_STORAGE_EXTERNAL;
+ }
}
return true;
{
AppLog(" - OspCompat=%s", pOspCompat);
__pContext->__isOspCompat = true;
+
+ AppLog("INSTALLATION_STORAGE = [INTERNAL]");
+ __isInternalStorage = true;
}
}