2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file InstallerDefs.h
21 #ifndef _INSTALLER_DEFS_H_
22 #define _INSTALLER_DEFS_H_
24 #include "InstallerUtil.h"
26 #define OSP_INSTALLER_VERSION "version=[20130520.1]"
28 #define DIR_BIN L"/bin"
29 #define DIR_INFO L"/info"
30 #define DIR_RES L"/res"
31 #define DIR_DATA L"/data"
32 #define DIR_ICONS L"/icons"
33 #define DIR_SHARED L"/shared"
34 #define DIR_LIB L"/lib"
35 #define DIR_SETTING L"/setting"
36 #define DIR_CONTENTS L"/contents"
37 #define DIR_SHARED_RES L"/shared/res"
38 #define DIR_SHARED_DATA L"/shared/data"
39 #define DIR_SHARED_TRUSTED L"/shared/trusted"
41 #define SLP_DIR_BIN L"/bin"
42 #define SLP_DIR_RES L"/res"
43 #define SLP_DIR_DATA L"/data"
44 #define SLP_APP_PATH L"/opt/apps"
46 #define PATH_OPT_APPS L"/opt/apps"
47 #define PATH_USR_APPS L"/usr/apps"
48 #define PATH_OPT_USR L"/opt/usr"
49 #define PATH_OPT_USR_APPS L"/opt/usr/apps"
51 #define SLP_FONT_PATH L"/opt/share/fonts"
53 #define DIR_DESKTOP L"/opt/share/applications/%S.desktop"
54 #define PACKAGE_NAME_PREFIX_ORG L"org.tizen."
55 #define PACKAGE_NAME_RULE_ORG L"org.tizen.%ls#%s"
57 #define PACKAGE_NAME_RULE L"%ls.%s"
59 #define FILE_EXT_INFO L"info"
60 #define VERSION_INFO_FILE L"/info/version.info"
61 #define COMPAT_INFO_FILE L"/info/compat.info"
62 #define UISCALABILITY_INFO_FILE L"/info/uiscalability.info"
63 #define WEBSERVICE_INFO_FILE L"/info/webservice.info"
64 #define TYPE_INFO_FILE L"/info/type.info"
65 #define PACKAGE_XML_FILE L"/info/manifest.xml"
67 #define SIGNATURE1_XML_FILE L"/signature1.xml"
68 #define AUTHOR_SIGNATURE_XML_FILE L"/author-signature.xml"
70 #define UISCALABILITY_INFO L"1 %ls %ls %ls"
72 #define CONFIG_PATH L"/usr/etc/installer-config.ini"
74 #define UIAPP_LOADER_PATH "/usr/lib/osp/osp-ui-app-loader" // UiApp
75 #define SERVICEAPP_LOADER_PATH "/usr/lib/osp/osp-service-app-loader" // ServiceApp
76 #define SYSTEMSERIVCE_LOADER_PATH "/usr/lib/osp/osp-system-service-loader" // System Service
77 #define IME_PATH "/opt/apps/scim/lib/scim-1.0/1.4.0/Helper"
79 #define SUB_MODE_APPCONTROL_NAME L"_AppControl"
81 #define APP_OWNER_ID 5000
82 #define APP_GROUP_ID 5000
84 #define PACKAGE_ID_LENGTH 10
85 #define APP_DIR_LENGTH 20
87 #define TEST_ARG_COUNT 1
88 #define COMMAND_ARG_COUNT 3
89 #define TERMINATE_RETRY_COUNT 300
91 #define DIR_OSP_APPLICATIONS_TEMP L"/opt/usr/apps/__@@osp_tmp@@__"
92 #define DIR_INSTALL_LOGS L"/opt/usr/apps/logs"
94 #define DIR_RO_PACKAGE_SYSTEM_MANIFEST L"/usr/share/packages/%ls.xml"
95 #define DIR_RW_PACKAGE_SYSTEM_MANIFEST L"/opt/share/packages/%ls.xml"
97 #define DIR_MEMORYCARD_OSP_APPLICATIONS L"/opt/storage/sdcard/apps"
98 #define DIR_MEMORYCARD_OSP_APPLICATIONS_TEMP L"/opt/storage/sdcard/apps/__@@osp_tmp@@__"
99 #define DIR_MEMORYCARD_INSTALLATION L"/opt/storage/sdcard/installtosdcard"
101 #define PERM_BASE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) // 0644
102 #define PERM_EXECUTE (S_IXUSR | S_IXGRP | S_IXOTH)
103 #define PERM_WRITE (S_IWUSR | S_IWGRP | S_IWOTH)
105 #define PERM_OWNER_ROOT 0
106 #define PERM_OWNER_APP 1
108 #define PERM_SMACK_0 0
109 #define PERM_SMACK_1 1
110 #define PERM_SMACK_2 2
111 #define PERM_SMACK_3 3
113 #define TIZEN_PRIVILEGE_WEB_SERVICE "http://tizen.org/privilege/web.service"
114 #define TIZEN_CATEGORY_IME "http://tizen.org/category/ime"
115 #define TIZEN_CATEGORY_HOMESCREEN "http://tizen.org/category/homescreen"
116 #define TIZEN_CATEGORY_LOCKSCREEN "http://tizen.org/category/lockscreen"
117 #define TIZEN_CATEGORY_MENUSCREEN "http://tizen.org/category/menuscreen"
118 #define TIZEN_CATEGORY_ANTIVIRUS "http://tizen.org/category/antivirus"
120 #define METADATA_FONT L"http://developer.samsung.com/tizen/metadata/font"
122 #define DIR_APPLICATIONS_TMP "/opt/usr/apps/tmp"
124 #define INSTALLER_RDS_FILE_NAME ".rds_delta"
125 #define INSTALLER_RDS_DELETE_STR "delete"
126 #define INSTALLER_RDS_ADD_STR "add"
127 #define INSTALLER_RDS_MODIFY_STR "modify"
129 static const int BLOCK_SIZE = 4096;
130 static const int SIGNATURE_FILE_NUMBER_DISTRIBUTOR = 1;
132 #define OSP_INSTALLER "osp-installer"
136 #define AppLog(...) AppLogTagInternal(OSP_INSTALLER, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__); \
137 InstallerUtil::AppendLog(__PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
142 #define TryCatch(condition, expr, ...) \
143 if (!(condition)) { \
144 AppLogExceptionTag(OSP_INSTALLER, __VA_ARGS__); \
146 InstallerUtil::AppendLog(__PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__); \
154 #define TryReturn(condition, returnValue, ...) \
155 if (!(condition)) { \
156 AppLogExceptionTag(OSP_INSTALLER, __VA_ARGS__); \
157 InstallerUtil::AppendLog(__PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__); \
158 return returnValue; \
163 enum InstallationSetStep
165 INSTALLER_STEP_REMOVE,
170 enum InstallationState
172 INSTALLER_STATE_READY,
173 INSTALLER_STATE_RUNNING,
177 enum InstallationStep
179 INSTALLER_STEP_NONE = 0,
181 INSTALLER_STEP_CHECK_PACKAGE,
183 INSTALLER_STEP_PARSE_MANIFEST,
184 INSTALLER_STEP_CHECK_SYSTEM,
185 INSTALLER_STEP_UNPACK,
186 INSTALLER_STEP_LICENSE,
187 INSTALLER_STEP_PARSE_SIGNATURE,
189 INSTALLER_STEP_INIT_UNINSTALL,
190 INSTALLER_STEP_UNINSTALL,
193 INSTALLER_STEP_RDS_INIT,
202 INSTALLER_TYPE_INSTALLER,
203 INSTALLER_TYPE_PACKAGE,
204 INSTALLER_TYPE_DIRECTORY,
205 INSTALLER_TYPE_GUEST,
206 INSTALLER_TYPE_PRELOADED,
208 INSTALLER_TYPE_RESTORATION,
214 INSTALLER_OPTION_NONE = 0,
215 INSTALLER_OPTION_NORMAL = 1,
216 INSTALLER_OPTION_IDE = 2,
217 INSTALLER_OPTION_PRELOADED = 4,
218 INSTALLER_OPTION_HYBRID = 8,
219 INSTALLER_OPTION_NO_INPUT = 16,
220 INSTALLER_OPTION_FILELOG_ON = 32,
221 INSTALLER_OPTION_UPDATE_STDOUT = 64,
222 INSTALLER_OPTION_CSC = 128,
228 INSTALLER_ERROR_NONE = 0,
229 INSTALLER_ERROR_PACKAGE_NOT_FOUND = 1,
230 INSTALLER_ERROR_PACKAGE_INVALID = 2,
231 INSTALLER_ERROR_PACKAGE_LOWER_VERSION = 3,
232 INSTALLER_ERROR_EXECUTABLE_NOT_FOUND = 4,
233 INSTALLER_ERROR_MANIFEST_NOT_FOUND = 11,
234 INSTALLER_ERROR_MANIFEST_INVALID = 12,
235 INSTALLER_ERROR_SIGNATURE_NOT_FOUND = 21,
236 INSTALLER_ERROR_SIGNATURE_INVALID = 22,
237 INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED = 23,
238 INSTALLER_ERROR_ROOT_CERTIFICATE_NOT_FOUND = 31,
239 INSTALLER_ERROR_CERTIFICATE_INVALID = 32,
240 INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED = 33,
241 INSTALLER_ERROR_CERTIFICATE_EXPIRED = 34,
242 INSTALLER_ERROR_PRIVILEGE_INVALID = 41,
243 INSTALLER_ERROR_MENU_ICON_NOT_FOUND = 51,
244 INSTALLER_ERROR_FATAL_ERROR = 61,
245 INSTALLER_ERROR_OUT_OF_STORAGE = 62,
246 INSTALLER_ERROR_OUT_OF_MEMORY = 63,
248 INSTALLER_ERROR_USER_CANCEL = 141,
249 INSTALLER_ERROR_UNMOUNT_FAILED = 142,
250 INSTALLER_ERROR_INTERNAL_STATE = 143,
251 INSTALLER_ERROR_DATABASE = 144,
252 INSTALLER_ERROR_DRM = 145,
255 enum InstallerOperation
257 INSTALLER_OPERATION_INSTALL,
258 INSTALLER_OPERATION_UNINSTALL,
259 INSTALLER_OPERATION_REINSTALL,
263 enum RootCertificateType
265 ROOT_CERTIFICATE_NONE = 0,
266 ROOT_CERTIFICATE_DEVELOPER,
267 ROOT_CERTIFICATE_PUBLIC,
268 ROOT_CERTIFICATE_PARTNER,
269 ROOT_CERTIFICATE_PARTNER_OPERATOR,
270 ROOT_CERTIFICATE_PARTNER_MANUFACTURER,
272 ROOT_CERTIFICATE_CERT_SVC_PUBLIC = (1 << 6),
273 ROOT_CERTIFICATE_CERT_SVC_PARTNER = (1 << 7),
274 ROOT_CERTIFICATE_CERT_SVC_PARTNER_OPERATOR = (1 << 8),
275 ROOT_CERTIFICATE_CERT_SVC_PARTNER_MANUFACTURER = (1 << 9),
276 ROOT_CERTIFICATE_CERT_SVC_PLATFORM = (1 << 10),
280 enum SignatureFileType
282 SIGNATURE_FILE_TYPE_NONE,
283 SIGNATURE_FILE_TYPE_AUTHOR,
284 SIGNATURE_FILE_TYPE_DISTRIBUTOR,
290 INSTALLER_MODE_INSTALL = 1,
291 INSTALLER_MODE_UNINSTALL = 2,
292 INSTALLER_MODE_RECURSIVE_DIRECTORY_INSTALL = 3,
293 INSTALLER_MODE_REINSTALL = 4,
294 INSTALLER_MODE_PARSE_CSC_STRING = 5,
301 CATEGORY_TYPE_HOME_SCREEN,
302 CATEGORY_TYPE_LOCK_SCREEN,
306 enum InstallationStorage
308 INSTALLATION_STORAGE_INTERNAL,
309 INSTALLATION_STORAGE_EXTERNAL,
313 enum InstallerRdsState
315 INSTALLER_RDS_STATE_NONE,
316 INSTALLER_RDS_STATE_DELETE,
317 INSTALLER_RDS_STATE_ADD,
318 INSTALLER_RDS_STATE_MODIFY,
339 PERM_DIR_SETTING = 5,
340 PERM_DIR_SHARED_RES = 6,
341 PERM_DIR_SHARED_DATA = 7,
342 PERM_DIR_SHARED_TRUSTED = 8,
349 PRIVILEGE_LEVEL_PUBLIC,
350 PRIVILEGE_LEVEL_PARTNER,
351 PRIVILEGE_LEVEL_PLATFORM,
355 #endif // _INSTALLER_DEFS_H_