// // Open Service Platform // Copyright (c) 2012 Samsung Electronics Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /** * @file InstallerDefs.h */ #ifndef _INSTALLER_DEFS_H_ #define _INSTALLER_DEFS_H_ #include "InstallerUtil.h" #define OSP_INSTALLER_VERSION "version=[20130315.1]" #define DIR_BIN L"/bin" #define DIR_INFO L"/info" #define DIR_RES L"/res" #define DIR_DATA L"/data" #define DIR_ICONS L"/icons" #define DIR_SHARED L"/shared" #define DIR_LIB L"/lib" #define DIR_SETTING L"/setting" #define DIR_CONTENTS L"/contents" #define DIR_SHARED_RES L"/shared/res" #define DIR_SHARED_DATA L"/shared/data" #define DIR_SHARED_TRUSTED L"/shared/trusted" #define SLP_DIR_BIN L"/bin" #define SLP_DIR_RES L"/res" #define SLP_DIR_DATA L"/data" #define SLP_APP_PATH L"/opt/apps" #define PATH_OPT_APPS L"/opt/apps" #define PATH_USR_APPS L"/usr/apps" #define PATH_OPT_USR L"/opt/usr" #define PATH_OPT_USR_APPS L"/opt/usr/apps" #define SLP_FONT_PATH L"/opt/share/fonts" #define DIR_DESKTOP L"/opt/share/applications/%S.desktop" #define PACKAGE_NAME_PREFIX_ORG L"org.tizen." #define PACKAGE_NAME_RULE_ORG L"org.tizen.%ls#%s" #define PACKAGE_NAME_RULE L"%ls.%s" #define FILE_EXT_INFO L"info" #define VERSION_INFO_FILE L"/info/version.info" #define COMPAT_INFO_FILE L"/info/compat.info" #define UISCALABILITY_INFO_FILE L"/info/uiscalability.info" #define WEBSERVICE_INFO_FILE L"/info/webservice.info" #define TYPE_INFO_FILE L"/info/type.info" #define PACKAGE_XML_FILE L"/info/manifest.xml" #define SIGNATURE1_XML_FILE L"/signature1.xml" #define AUTHOR_SIGNATURE_XML_FILE L"/author-signature.xml" #define UISCALABILITY_INFO L"1 %ls %ls %ls" #define CONFIG_PATH L"/usr/etc/installer-config.ini" #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 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" #define APP_OWNER_ID 5000 #define APP_GROUP_ID 5000 #define PACKAGE_ID_LENGTH 10 #define APP_DIR_LENGTH 20 #define TEST_ARG_COUNT 1 #define COMMAND_ARG_COUNT 3 #define TERMINATE_RETRY_COUNT 300 #define DIR_OSP_APPLICATIONS_TEMP L"/opt/usr/apps/__@@osp_tmp@@__" #define DIR_RO_PACKAGE_SYSTEM_MANIFEST L"/usr/share/packages/%ls.xml" #define DIR_RW_PACKAGE_SYSTEM_MANIFEST L"/opt/share/packages/%ls.xml" #define DIR_MEMORYCARD_OSP_APPLICATIONS L"/opt/storage/sdcard/apps" #define DIR_MEMORYCARD_OSP_APPLICATIONS_TEMP L"/opt/storage/sdcard/apps/__@@osp_tmp@@__" #define DIR_MEMORYCARD_INSTALLATION L"/opt/storage/sdcard/installtosdcard" #define PERM_BASE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) // 0644 #define PERM_EXECUTE (S_IXUSR | S_IXGRP | S_IXOTH) #define PERM_WRITE (S_IWUSR | S_IWGRP | S_IWOTH) #define TIZEN_PRIVILEGE_WEB_SERVICE "http://tizen.org/privilege/web.service" #define TIZEN_CATEGORY_IME "http://tizen.org/category/ime" #define TIZEN_CATEGORY_HOMESCREEN "http://tizen.org/category/homescreen" #define TIZEN_CATEGORY_LOCKSCREEN "http://tizen.org/category/lockscreen" #define TIZEN_CATEGORY_MENUSCREEN "http://tizen.org/category/menuscreen" static const int BLOCK_SIZE = 4096; #define OSP_INSTALLER "osp-installer" #ifdef AppLog #undef AppLog #define AppLog(...) AppLogTagInternal(OSP_INSTALLER, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__); \ InstallerUtil::AppendLog(__PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__); #endif #ifdef TryCatch #undef TryCatch #define TryCatch(condition, expr, ...) \ if (!(condition)) { \ AppLogExceptionTag(OSP_INSTALLER, __VA_ARGS__); \ expr; \ InstallerUtil::AppendLog(__PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__); \ goto CATCH; \ } \ else {;} #endif #ifdef TryReturn #undef TryReturn #define TryReturn(condition, returnValue, ...) \ if (!(condition)) { \ AppLogExceptionTag(OSP_INSTALLER, __VA_ARGS__); \ InstallerUtil::AppendLog(__PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__); \ return returnValue; \ } \ else {;} #endif enum InstallationSetStep { INSTALLER_STEP_REMOVE, INSTALLER_STEP_SET, }; enum InstallationState { INSTALLER_STATE_READY, INSTALLER_STATE_RUNNING, }; enum InstallationStep { INSTALLER_STEP_NONE = 0, INSTALLER_STEP_INIT, INSTALLER_STEP_CHECK_PACKAGE, INSTALLER_STEP_DRM, INSTALLER_STEP_PARSE_MANIFEST, INSTALLER_STEP_CHECK_SYSTEM, INSTALLER_STEP_UNPACK, INSTALLER_STEP_LICENSE, INSTALLER_STEP_PARSE_SIGNATURE, INSTALLER_STEP_INIT_UNINSTALL, INSTALLER_STEP_UNINSTALL, INSTALLER_STEP_END, INSTALLER_STEP_MAX, }; enum InstallerType { INSTALLER_TYPE_INSTALLER, INSTALLER_TYPE_PACKAGE, INSTALLER_TYPE_DIRECTORY, INSTALLER_TYPE_GUEST, INSTALLER_TYPE_PRELOADED, INSTALLER_TYPE_IDE, INSTALLER_TYPE_RESTORATION, }; enum InstallerOption { INSTALLER_OPTION_NONE = 0, INSTALLER_OPTION_NORMAL = 1, INSTALLER_OPTION_IDE = 2, INSTALLER_OPTION_PRELOADED = 4, INSTALLER_OPTION_HYBRID = 8, INSTALLER_OPTION_NO_INPUT = 16, INSTALLER_OPTION_FILELOG_ON = 32, }; enum InstallerError { INSTALLER_ERROR_NONE = 0, INSTALLER_ERROR_PACKAGE_NOT_FOUND = 1, INSTALLER_ERROR_PACKAGE_INVALID = 2, INSTALLER_ERROR_PACKAGE_LOWER_VERSION = 3, INSTALLER_ERROR_EXECUTABLE_NOT_FOUND = 4, INSTALLER_ERROR_MANIFEST_NOT_FOUND = 11, INSTALLER_ERROR_MANIFEST_INVALID = 12, INSTALLER_ERROR_SIGNATURE_NOT_FOUND = 21, INSTALLER_ERROR_SIGNATURE_INVALID = 22, INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED = 23, INSTALLER_ERROR_ROOT_CERTIFICATE_NOT_FOUND = 31, INSTALLER_ERROR_CERTIFICATE_INVALID = 32, INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED = 33, INSTALLER_ERROR_CERTIFICATE_EXPIRED = 34, INSTALLER_ERROR_PRIVILEGE_INVALID = 41, INSTALLER_ERROR_MENU_ICON_NOT_FOUND = 51, INSTALLER_ERROR_FATAL_ERROR = 61, INSTALLER_ERROR_OUT_OF_STORAGE = 62, INSTALLER_ERROR_OUT_OF_MEMORY = 63, INSTALLER_ERROR_USER_CANCEL = 141, INSTALLER_ERROR_UNMOUNT_FAILED = 142, INSTALLER_ERROR_INTERNAL_STATE = 143, INSTALLER_ERROR_DATABASE = 144, INSTALLER_ERROR_DRM = 145, }; enum InstallerOperation { INSTALLER_OPERATION_INSTALL, INSTALLER_OPERATION_UNINSTALL, }; enum RootCertificateType { ROOT_CERTIFICATE_NONE, ROOT_CERTIFICATE_DEVELOPER, ROOT_CERTIFICATE_PUBLIC, ROOT_CERTIFICATE_PARTNER, ROOT_CERTIFICATE_PARTNER_OPERATOR, ROOT_CERTIFICATE_PARTNER_MANUFACTURER, }; enum { INSTALLER_MODE_INSTALL = 1, INSTALLER_MODE_UNINSTALL = 2, INSTALLER_MODE_RECURSIVE_DIRECTORY_INSTALL = 3, }; enum CategoryType { CATEGORY_TYPE_NONE, CATEGORY_TYPE_IME, CATEGORY_TYPE_HOME_SCREEN, CATEGORY_TYPE_LOCK_SCREEN, }; enum InstallationStorage { INSTALLATION_STORAGE_INTERNAL, INSTALLATION_STORAGE_EXTERNAL, }; #endif // _INSTALLER_DEFS_H_