Remove intel drm
[platform/framework/native/installer.git] / inc / InstallerDefs.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17 /**
18  * @file        InstallerDefs.h
19  */
20
21 #ifndef _INSTALLER_DEFS_H_
22 #define _INSTALLER_DEFS_H_
23
24 #include "InstallerUtil.h"
25
26 #define OSP_INSTALLER_VERSION "version=[20130326.1]"
27
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"
40
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"
45
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"
50
51 #define SLP_FONT_PATH           L"/opt/share/fonts"
52
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"
56
57 #define PACKAGE_NAME_RULE                       L"%ls.%s"
58
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"
66
67 #define SIGNATURE1_XML_FILE                     L"/signature1.xml"
68 #define AUTHOR_SIGNATURE_XML_FILE       L"/author-signature.xml"
69
70 #define UISCALABILITY_INFO                      L"1 %ls %ls %ls"
71
72 #define CONFIG_PATH                                                     L"/usr/etc/installer-config.ini"
73
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"
78
79 #define SUB_MODE_APPCONTROL_NAME        L"_AppControl"
80
81 #define APP_OWNER_ID            5000
82 #define APP_GROUP_ID            5000
83
84 #define PACKAGE_ID_LENGTH       10
85 #define APP_DIR_LENGTH          20
86
87 #define TEST_ARG_COUNT          1
88 #define COMMAND_ARG_COUNT       3
89 #define TERMINATE_RETRY_COUNT   300
90
91 #define DIR_OSP_APPLICATIONS_TEMP                               L"/opt/usr/apps/__@@osp_tmp@@__"
92
93 #define DIR_RO_PACKAGE_SYSTEM_MANIFEST                  L"/usr/share/packages/%ls.xml"
94 #define DIR_RW_PACKAGE_SYSTEM_MANIFEST                  L"/opt/share/packages/%ls.xml"
95
96 #define DIR_MEMORYCARD_OSP_APPLICATIONS                 L"/opt/storage/sdcard/apps"
97 #define DIR_MEMORYCARD_OSP_APPLICATIONS_TEMP    L"/opt/storage/sdcard/apps/__@@osp_tmp@@__"
98 #define DIR_MEMORYCARD_INSTALLATION                             L"/opt/storage/sdcard/installtosdcard"
99
100 #define PERM_BASE                                                               (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)         // 0644
101 #define PERM_EXECUTE                                                    (S_IXUSR | S_IXGRP | S_IXOTH)
102 #define PERM_WRITE                                                              (S_IWUSR | S_IWGRP | S_IWOTH)
103
104 #define TIZEN_PRIVILEGE_WEB_SERVICE                             "http://tizen.org/privilege/web.service"
105 #define TIZEN_CATEGORY_IME                                              "http://tizen.org/category/ime"
106 #define TIZEN_CATEGORY_HOMESCREEN                               "http://tizen.org/category/homescreen"
107 #define TIZEN_CATEGORY_LOCKSCREEN                               "http://tizen.org/category/lockscreen"
108 #define TIZEN_CATEGORY_MENUSCREEN                               "http://tizen.org/category/menuscreen"
109
110 static const int BLOCK_SIZE = 4096;
111
112 #define OSP_INSTALLER   "osp-installer"
113
114 #ifdef AppLog
115 #undef AppLog
116 #define AppLog(...)             AppLogTagInternal(OSP_INSTALLER, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__); \
117                                                 InstallerUtil::AppendLog(__PRETTY_FUNCTION__, __LINE__, false, __VA_ARGS__);
118 #endif
119
120 #ifdef TryCatch
121 #undef TryCatch
122 #define TryCatch(condition, expr, ...) \
123         if (!(condition)) { \
124                 AppLogExceptionTag(OSP_INSTALLER, __VA_ARGS__); \
125                 expr; \
126                 InstallerUtil::AppendLog(__PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__); \
127                 goto CATCH;     \
128         } \
129         else {;}
130 #endif
131
132 #ifdef TryReturn
133 #undef TryReturn
134 #define TryReturn(condition, returnValue, ...)  \
135         if (!(condition)) { \
136                 AppLogExceptionTag(OSP_INSTALLER, __VA_ARGS__); \
137                 InstallerUtil::AppendLog(__PRETTY_FUNCTION__, __LINE__, true, __VA_ARGS__); \
138                 return returnValue;     \
139         } \
140         else {;}
141 #endif
142
143 enum InstallationSetStep
144 {
145         INSTALLER_STEP_REMOVE,
146         INSTALLER_STEP_SET,
147
148 };
149
150 enum InstallationState
151 {
152         INSTALLER_STATE_READY,
153         INSTALLER_STATE_RUNNING,
154
155 };
156
157 enum InstallationStep
158 {
159         INSTALLER_STEP_NONE = 0,
160         INSTALLER_STEP_INIT,
161         INSTALLER_STEP_CHECK_PACKAGE,
162         INSTALLER_STEP_DRM,
163         INSTALLER_STEP_PARSE_MANIFEST,
164         INSTALLER_STEP_CHECK_SYSTEM,
165         INSTALLER_STEP_UNPACK,
166         INSTALLER_STEP_LICENSE,
167         INSTALLER_STEP_PARSE_SIGNATURE,
168
169         INSTALLER_STEP_INIT_UNINSTALL,
170         INSTALLER_STEP_UNINSTALL,
171         INSTALLER_STEP_END,
172
173         INSTALLER_STEP_MAX,
174
175 };
176
177 enum InstallerType
178 {
179         INSTALLER_TYPE_INSTALLER,
180         INSTALLER_TYPE_PACKAGE,
181         INSTALLER_TYPE_DIRECTORY,
182         INSTALLER_TYPE_GUEST,
183         INSTALLER_TYPE_PRELOADED,
184         INSTALLER_TYPE_IDE,
185         INSTALLER_TYPE_RESTORATION,
186
187 };
188
189 enum InstallerOption
190 {
191         INSTALLER_OPTION_NONE = 0,
192         INSTALLER_OPTION_NORMAL = 1,
193         INSTALLER_OPTION_IDE = 2,
194         INSTALLER_OPTION_PRELOADED = 4,
195         INSTALLER_OPTION_HYBRID = 8,
196         INSTALLER_OPTION_NO_INPUT = 16,
197         INSTALLER_OPTION_FILELOG_ON = 32,
198
199 };
200
201 enum InstallerError
202 {
203         INSTALLER_ERROR_NONE = 0,
204         INSTALLER_ERROR_PACKAGE_NOT_FOUND = 1,
205         INSTALLER_ERROR_PACKAGE_INVALID = 2,
206         INSTALLER_ERROR_PACKAGE_LOWER_VERSION = 3,
207         INSTALLER_ERROR_EXECUTABLE_NOT_FOUND = 4,
208         INSTALLER_ERROR_MANIFEST_NOT_FOUND = 11,
209         INSTALLER_ERROR_MANIFEST_INVALID = 12,
210         INSTALLER_ERROR_SIGNATURE_NOT_FOUND = 21,
211         INSTALLER_ERROR_SIGNATURE_INVALID = 22,
212         INSTALLER_ERROR_SIGNATURE_VERIFICATION_FAILED = 23,
213         INSTALLER_ERROR_ROOT_CERTIFICATE_NOT_FOUND = 31,
214         INSTALLER_ERROR_CERTIFICATE_INVALID = 32,
215         INSTALLER_ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED = 33,
216         INSTALLER_ERROR_CERTIFICATE_EXPIRED = 34,
217         INSTALLER_ERROR_PRIVILEGE_INVALID = 41,
218         INSTALLER_ERROR_MENU_ICON_NOT_FOUND = 51,
219         INSTALLER_ERROR_FATAL_ERROR = 61,
220         INSTALLER_ERROR_OUT_OF_STORAGE = 62,
221         INSTALLER_ERROR_OUT_OF_MEMORY = 63,
222
223         INSTALLER_ERROR_USER_CANCEL = 141,
224         INSTALLER_ERROR_UNMOUNT_FAILED = 142,
225         INSTALLER_ERROR_INTERNAL_STATE = 143,
226         INSTALLER_ERROR_DATABASE = 144,
227         INSTALLER_ERROR_DRM = 145,
228 };
229
230 enum InstallerOperation
231 {
232         INSTALLER_OPERATION_INSTALL,
233         INSTALLER_OPERATION_UNINSTALL,
234
235 };
236
237 enum RootCertificateType
238 {
239         ROOT_CERTIFICATE_NONE,
240         ROOT_CERTIFICATE_DEVELOPER,
241         ROOT_CERTIFICATE_PUBLIC,
242         ROOT_CERTIFICATE_PARTNER,
243         ROOT_CERTIFICATE_PARTNER_OPERATOR,
244         ROOT_CERTIFICATE_PARTNER_MANUFACTURER,
245
246 };
247
248 enum
249 {
250         INSTALLER_MODE_INSTALL = 1,
251         INSTALLER_MODE_UNINSTALL = 2,
252         INSTALLER_MODE_RECURSIVE_DIRECTORY_INSTALL = 3,
253 };
254
255 enum CategoryType
256 {
257         CATEGORY_TYPE_NONE,
258         CATEGORY_TYPE_IME,
259         CATEGORY_TYPE_HOME_SCREEN,
260         CATEGORY_TYPE_LOCK_SCREEN,
261
262 };
263
264 enum InstallationStorage
265 {
266         INSTALLATION_STORAGE_INTERNAL,
267         INSTALLATION_STORAGE_EXTERNAL,
268
269 };
270
271 #endif // _INSTALLER_DEFS_H_