summaryrefslogtreecommitdiff
path: root/inc/InstallerDefs.h
blob: 88fb9dae189c3f85b458e742942adc496c106133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
//
// 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_

#define OSP_INSTALLER_VERSION "osp-installer version = 20130113.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 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 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 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 APPID_LENGTH		10
#define APP_DIR_LENGTH		20

#define TEST_ARG_COUNT		1
#define COMMAND_ARG_COUNT	3

#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 AppLogTag
#undef AppLogTag
#define AppLogTag(tag, ...)						AppLogTagInternal(tag, "|        |", 0, __VA_ARGS__);\
												fprintf(stderr, __VA_ARGS__);fprintf(stderr, "\n");
#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_SYSTEM,
	INSTALLER_STEP_CHECK_PACKAGE,
	INSTALLER_STEP_DRM,
	INSTALLER_STEP_PARSE_MANIFEST,
	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 RequesterType
{
	REQUESTER_TYPE_NORMAL,
	REQUESTER_TYPE_IDE,
	REQUESTER_TYPE_PRELOADED,

};

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
{
	INSTALLER_PREFIX_TYPE_NONE,
	INSTALLER_PREFIX_TYPE_ORG,

};

enum CategoryType
{
	CATEGORY_TYPE_NONE,
	CATEGORY_TYPE_IME,
	CATEGORY_TYPE_HOME_SCREEN,
	CATEGORY_TYPE_LOCK_SCREEN,

};

#endif // _INSTALLER_DEFS_H_