diff options
-rwxr-xr-x | inc/InstallerDefs.h | 12 | ||||
-rwxr-xr-x | src/Context/InstallationContextData.cpp | 1 | ||||
-rwxr-xr-x | src/Context/InstallationContextData.h | 2 | ||||
-rwxr-xr-x | src/Manager/ConfigurationManager.cpp | 48 | ||||
-rwxr-xr-x | src/Manager/InstallerManager.cpp | 1 | ||||
-rwxr-xr-x | src/Manager/PermissionManager.cpp | 2 | ||||
-rwxr-xr-x | src/XmlHandler/ManifestGenerator.cpp | 24 | ||||
-rwxr-xr-x | src/XmlHandler/ManifestHandler.cpp | 11 |
8 files changed, 54 insertions, 47 deletions
diff --git a/inc/InstallerDefs.h b/inc/InstallerDefs.h index 961ea64..c0532eb 100755 --- a/inc/InstallerDefs.h +++ b/inc/InstallerDefs.h @@ -21,7 +21,7 @@ #ifndef _INSTALLER_DEFS_H_ #define _INSTALLER_DEFS_H_ -#define OSP_INSTALLER_VERSION "osp-installer version = 20130116.2" +#define OSP_INSTALLER_VERSION "osp-installer version = 20130117.1" #define DIR_BIN L"/bin" #define DIR_INFO L"/info" @@ -67,7 +67,7 @@ #define UIAPP_LOADER_PATH "/usr/lib/osp/osp-ui-app-loader" // UiApp #define SERVICEAPP_LOADER_PATH "/usr/lib/osp/osp-service-app-loader" // ServiceApp -#define SYSTEMAPP_LOADER_PATH "/usr/lib/osp/osp-system-service-loader" // System Service +#define SYSTEMSERIVCE_LOADER_PATH "/usr/lib/osp/osp-system-service-loader" // System Service #define IME_PATH "/opt/apps/scim/lib/scim-1.0/1.4.0/Helper" #define SUB_MODE_APPCONTROL_NAME L"_AppControl" @@ -106,8 +106,8 @@ static const int BLOCK_SIZE = 4096; #ifdef AppLogTag #undef AppLogTag -#define AppLogTag(tag, ...) AppLogTagInternal(tag, " |", 0, __VA_ARGS__); \ - fprintf(stderr, " |");fprintf(stderr, __VA_ARGS__);fprintf(stderr, "\n"); +#define AppLogTag(tag, ...) AppLogTagInternal(tag, " | ", 0, __VA_ARGS__); \ + fprintf(stderr, " | ");fprintf(stderr, __VA_ARGS__);fprintf(stderr, "\n"); #endif #ifdef TryCatch @@ -116,7 +116,7 @@ static const int BLOCK_SIZE = 4096; if (!(condition)) { \ AppLogExceptionTag(OSP_INSTALLER, __VA_ARGS__); \ expr; \ - fprintf(stderr, " |");fprintf(stderr, __VA_ARGS__);fprintf(stderr, "\n"); \ + fprintf(stderr, " | ");fprintf(stderr, __VA_ARGS__);fprintf(stderr, "\n"); \ goto CATCH; \ } \ else {;} @@ -127,7 +127,7 @@ static const int BLOCK_SIZE = 4096; #define TryReturn(condition, returnValue, ...) \ if (!(condition)) { \ AppLogExceptionTag(OSP_INSTALLER, __VA_ARGS__); \ - fprintf(stderr, " |");fprintf(stderr, __VA_ARGS__);fprintf(stderr, "\n"); \ + fprintf(stderr, " | ");fprintf(stderr, __VA_ARGS__);fprintf(stderr, "\n"); \ return returnValue; \ } \ else {;} diff --git a/src/Context/InstallationContextData.cpp b/src/Context/InstallationContextData.cpp index 23b4d1c..47289b1 100755 --- a/src/Context/InstallationContextData.cpp +++ b/src/Context/InstallationContextData.cpp @@ -236,6 +236,7 @@ AppData::AppData() ,__pAccountDataList(null) ,__pAppControlDataList(null) ,__legacyAppControls(false) +,__isSystemService(false) { __pCategoryList = new (std::nothrow) ArrayListT<String*>; __pAccountDataList = new (std::nothrow) ArrayListT<AccountData*>; diff --git a/src/Context/InstallationContextData.h b/src/Context/InstallationContextData.h index e118ae4..e28e5d9 100755 --- a/src/Context/InstallationContextData.h +++ b/src/Context/InstallationContextData.h @@ -135,11 +135,13 @@ public: virtual ~AppData(); Tizen::Base::String name; + Tizen::Base::String __appId; Tizen::Base::Collection::IListT<Tizen::Base::String*>* __pCategoryList; Tizen::Base::Collection::IListT<AccountData*>* __pAccountDataList; Tizen::Base::Collection::IListT<AppControlData*>* __pAppControlDataList; bool __legacyAppControls; + bool __isSystemService; private: }; diff --git a/src/Manager/ConfigurationManager.cpp b/src/Manager/ConfigurationManager.cpp index 7f927a2..3bd818f 100755 --- a/src/Manager/ConfigurationManager.cpp +++ b/src/Manager/ConfigurationManager.cpp @@ -60,7 +60,7 @@ bool ConfigurationManager::CreateFile(InstallationContext* pContext) { bool res = false; - const char* pBinaryPath = null; + // const char* pBinaryPath = null; String xmlPath; char* pXmlPath = null; int err = 0; @@ -99,16 +99,22 @@ ConfigurationManager::CreateFile(InstallationContext* pContext) CreateInfoFile(webServiceInfoFile, null); } + IListT<AppData*>* pAppDataList = pContext->__pAppDataList; + TryReturn(pAppDataList, false, "[osp-installer] pAppDataList is null"); + + // legacy _PackageAppInfoImpl* pAppInfoImpl = null; ArrayList* pAppList = null; pAppList = pPackageInfoImpl->GetAppInfoList(); for (int i = 0 ; i < pAppList->GetCount(); i++) { + AppData* pAppData = null; + pAppDataList->GetAt(i, pAppData); + TryReturn(pAppData, false, "[osp-installer] pAppData is null"); + pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i)); if (pAppInfoImpl) { - result r = E_SUCCESS; - String appName; appName = pAppInfoImpl->GetName(); @@ -121,12 +127,6 @@ ConfigurationManager::CreateFile(InstallationContext* pContext) String binaryPath; binaryPath.Format(1024, L"%ls%ls/%ls", rootPath.GetPointer(), DIR_BIN, appName.GetPointer()); - String tempBinaryPath; - tempBinaryPath.Format(1024, L"%ls%ls/.%ls", rootPath.GetPointer(), DIR_BIN, appName.GetPointer()); - - pBinaryPath = _StringConverter::CopyToCharArrayN(binaryPath); - TryCatch(pBinaryPath, res = false, "[osp-installer] pBinaryPath is null"); - if (File::IsFileExist(binaryPath) == true) { InstallerUtil::Remove(binaryPath); @@ -136,10 +136,8 @@ ConfigurationManager::CreateFile(InstallationContext* pContext) { //err = symlink(UIAPP_LOADER_PATH, pBinaryPath); - r = File::Copy(UIAPP_LOADER_PATH, pBinaryPath, false); - TryCatch(!IsFailed(r), res = false, "[osp-installer] File::Copy() failed, filePath=[%s]", pBinaryPath); - - InstallerUtil::Copy(UIAPP_LOADER_PATH, tempBinaryPath); + AppLogTag(OSP_INSTALLER, "copy ui app loader"); + InstallerUtil::Copy(UIAPP_LOADER_PATH, binaryPath); ArrayList* pFeatureList = pAppInfoImpl->GetAppFeatureList(); TryCatch(pFeatureList, res = false, "[osp-installer] pFeatureList is null"); @@ -203,30 +201,19 @@ ConfigurationManager::CreateFile(InstallationContext* pContext) } else if (appType == L"ServiceApp") { - if (pContext->IsPreloaded() == false) + if (pContext->IsPreloaded() == true || pAppData->__isSystemService == true) { - //err = symlink(SERVICEAPP_LOADER_PATH, pBinaryPath); - - InstallerUtil::Copy(SERVICEAPP_LOADER_PATH, tempBinaryPath); - - r = File::Copy(SERVICEAPP_LOADER_PATH, pBinaryPath, false); - TryCatch(!IsFailed(r), res = false, "[osp-installer] File::Copy() failed, filePath=[%s]", pBinaryPath); + AppLogTag(OSP_INSTALLER, "copy system service loader"); + InstallerUtil::Copy(SYSTEMSERIVCE_LOADER_PATH, binaryPath); } else { - //err = symlink(SYSTEMAPP_LOADER_PATH, pBinaryPath); - - InstallerUtil::Copy(SYSTEMAPP_LOADER_PATH, tempBinaryPath); - - r = File::Copy(SYSTEMAPP_LOADER_PATH, pBinaryPath, false); - TryCatch(!IsFailed(r), res = false, "[osp-installer] File::Copy() failed, filePath=[%s]", pBinaryPath); + AppLogTag(OSP_INSTALLER, "copy service app loader"); + InstallerUtil::Copy(SERVICEAPP_LOADER_PATH, binaryPath); } } - InstallerUtil::ChangeMode(pBinaryPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); - - delete[] pBinaryPath; - pBinaryPath = null; + InstallerUtil::ChangeMode(binaryPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); } } @@ -315,7 +302,6 @@ ConfigurationManager::CreateFile(InstallationContext* pContext) res = true; CATCH: - delete[] pBinaryPath; delete[] pXmlPath; return res; diff --git a/src/Manager/InstallerManager.cpp b/src/Manager/InstallerManager.cpp index 1b98098..7f502cd 100755 --- a/src/Manager/InstallerManager.cpp +++ b/src/Manager/InstallerManager.cpp @@ -101,6 +101,7 @@ InstallerManager::Construct(const String& path, InstallerOperation operation, Re if (path.StartsWith(PATH_USR_APPS, 0) == true) { installerType = INSTALLER_TYPE_PRELOADED; + __pContext->SetPreloaded(true); } __pContext->SetInputPath(path); diff --git a/src/Manager/PermissionManager.cpp b/src/Manager/PermissionManager.cpp index cf1c9b2..aa11354 100755 --- a/src/Manager/PermissionManager.cpp +++ b/src/Manager/PermissionManager.cpp @@ -165,7 +165,7 @@ PermissionManager::SetDirectory(InstallationContext* pContext) // Create AppId.ExecutableName directory // This will be removed. - CreateSystemDirectory(pContext, appRootPath); + // CreateSystemDirectory(pContext, appRootPath); return true; } diff --git a/src/XmlHandler/ManifestGenerator.cpp b/src/XmlHandler/ManifestGenerator.cpp index 5ef8556..df234e1 100755 --- a/src/XmlHandler/ManifestGenerator.cpp +++ b/src/XmlHandler/ManifestGenerator.cpp @@ -792,18 +792,22 @@ ManifestGenerator::WriteAccounts(int index) return true; } - __pWriter->StartElement("Accounts"); + __pWriter->StartElement("account-list"); for (int i = 0; i < accountCount; i++) { - __pWriter->StartElement("AccountProvider"); + __pWriter->StartElement("account-provider"); AccountData* pAccountData = null; pAccountDataList->GetAt(i, pAccountData); TryReturn(pAccountData, false, "[osp-installer] pAccountData is null"); - __pWriter->WriteAttribute("ProviderId", pAccountData->__providerId); - __pWriter->WriteAttribute("MultipleAccountsSupport", pAccountData->__multipleAccountsSupport); + String multipleAccountsSupport = pAccountData->__multipleAccountsSupport; + multipleAccountsSupport.ToLowerCase(); + + __pWriter->WriteAttribute("appid", pAppData->__appId); + __pWriter->WriteAttribute("providerid", pAccountData->__providerId); + __pWriter->WriteAttribute("multiple-accounts-support", multipleAccountsSupport); String accountIcon = pAccountData->__accountIcon; if (accountIcon.IsEmpty() == false) @@ -811,7 +815,8 @@ ManifestGenerator::WriteAccounts(int index) String accountIconPath; accountIconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, accountIcon.GetPointer()); - __pWriter->StartElement("account-icon"); + __pWriter->StartElement("icon"); + __pWriter->WriteAttribute("section", "account"); __pWriter->WriteString(accountIconPath); __pWriter->EndElement(); } @@ -822,17 +827,18 @@ ManifestGenerator::WriteAccounts(int index) String accountSmallIconPath; accountSmallIconPath.Format(1024, L"%ls%ls/%ls", __pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, accountSmallIcon.GetPointer()); - __pWriter->StartElement("account-small-icon"); - __pWriter->WriteString(accountSmallIcon); + __pWriter->StartElement("icon"); + __pWriter->WriteAttribute("section", "account-small"); + __pWriter->WriteString(accountSmallIconPath); __pWriter->EndElement(); } WriteLanguageValue(pAccountData->__pNameList, L"label"); - __pWriter->EndElement(); // end of "AccountProvider" + __pWriter->EndElement(); // end of "account-provider" } - __pWriter->EndElement(); // end of "Accounts" + __pWriter->EndElement(); // end of "account-list" return true; } diff --git a/src/XmlHandler/ManifestHandler.cpp b/src/XmlHandler/ManifestHandler.cpp index a887f73..e167510 100755 --- a/src/XmlHandler/ManifestHandler.cpp +++ b/src/XmlHandler/ManifestHandler.cpp @@ -1248,6 +1248,7 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp) { AppLogTag(OSP_INSTALLER, " - Name=%s", pName); __pPackageAppInfoImpl->SetName(pName); + __pAppData->__appId = __pPackageInfoImpl->GetId() + L"." + pName; } char* pMain = pAttr->Find("Main"); @@ -1378,6 +1379,16 @@ ManifestHandler::ParseAppAttribute(XmlAttribute* pAttr, bool isUiApp) AddAppFeature("AutoRestart", pAutoRestart); AppLogTag(OSP_INSTALLER, " - AutoRestart=%s", pAutoRestart); } + + char *pSystemService = pAttr->Find("SystemService"); + if (pSystemService) + { + if (strcasecmp(pSystemService, "True") == 0) + { + __pAppData->__isSystemService = true; + AppLogTag(OSP_INSTALLER, " - SystemService=%s", pSystemService); + } + } } String appId; |