1 |
{************************************************************************} |
2 |
{ } |
3 |
{ Borland Delphi Visual Component Library } |
4 |
{ InterBase Express core components } |
5 |
{ } |
6 |
{ Copyright (c) 1998-2000 Inprise Corporation } |
7 |
{ } |
8 |
{ InterBase Express is based in part on the product } |
9 |
{ Free IB Components, written by Gregory H. Deatz for } |
10 |
{ Hoagland, Longo, Moran, Dunst & Doukas Company. } |
11 |
{ Free IB Components is used under license. } |
12 |
{ } |
13 |
{ The contents of this file are subject to the InterBase } |
14 |
{ Public License Version 1.0 (the "License"); you may not } |
15 |
{ use this file except in compliance with the License. You } |
16 |
{ may obtain a copy of the License at http://www.Inprise.com/IPL.html } |
17 |
{ Software distributed under the License is distributed on } |
18 |
{ an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either } |
19 |
{ express or implied. See the License for the specific language } |
20 |
{ governing rights and limitations under the License. } |
21 |
{ The Original Code was created by InterBase Software Corporation } |
22 |
{ and its successors. } |
23 |
{ Portions created by Inprise Corporation are Copyright (C) Inprise } |
24 |
{ Corporation. All Rights Reserved. } |
25 |
{ Contributor(s): Jeff Overcash } |
26 |
{ } |
27 |
{************************************************************************} |
28 |
|
29 |
{ |
30 |
InterBase Express provides component interfaces to |
31 |
functions introduced in InterBase 6.0. The Services |
32 |
components (TIB*Service, TIBServerProperties) and |
33 |
Install components (TIBInstall, TIBUninstall, TIBSetup) |
34 |
function only if you have installed InterBase 6.0 or |
35 |
later software |
36 |
} |
37 |
|
38 |
unit IBInstallHeader; |
39 |
|
40 |
|
41 |
interface |
42 |
|
43 |
uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs; |
44 |
|
45 |
{ InterBase Install API interface } |
46 |
type |
47 |
OPTIONS_HANDLE = integer; |
48 |
POPTIONS_HANDLE = ^OPTIONS_HANDLE; |
49 |
MSG_NO = longint; |
50 |
OPT = longint; |
51 |
TEXT = PChar; |
52 |
FP_ERROR = function(IscCode: MSG_NO; UserContext: Pointer; |
53 |
const ActionDescription : TEXT): Integer; stdcall; |
54 |
FP_STATUS = function(Status: Integer; UserContext: Pointer; |
55 |
const ActionDescription: TEXT): Integer; stdcall; |
56 |
|
57 |
const |
58 |
IB_INSTALL_DLL = 'ibinstall.dll'; {do not localize} |
59 |
{ These are the values the FP_ERROR routine can return. } |
60 |
isc_install_fp_retry = -1; |
61 |
isc_install_fp_continue = 0; |
62 |
isc_install_fp_abort = 1; |
63 |
|
64 |
{ isc_install_get_info info_types } |
65 |
isc_install_info_destination = 1; |
66 |
isc_install_info_opspace = 2 ; |
67 |
isc_install_info_opname = 3 ; |
68 |
isc_install_info_opdescription = 4; |
69 |
|
70 |
|
71 |
ISC_INSTALL_MAX_MESSAGE_LEN = 300; |
72 |
ISC_INSTALL_MAX_MESSAGES = 200; |
73 |
ISC_INSTALL_MAX_PATH = 256; |
74 |
|
75 |
{ Basic Components used to install InterBase } |
76 |
INTERBASE = 1000; |
77 |
IB_SERVER = 1001; |
78 |
IB_CLIENT = 1002; |
79 |
|
80 |
IB_CMD_TOOLS = 1003; |
81 |
IB_CMD_TOOLS_DB_MGMT = 1004; |
82 |
IB_CMD_TOOLS_USR_MGMT = 1005; |
83 |
IB_CMD_TOOLS_DB_QUERY = 1006; |
84 |
|
85 |
IB_GUI_TOOLS = 1007; |
86 |
|
87 |
IB_DOC = 1011; |
88 |
IB_EXAMPLES = 1012; |
89 |
IB_EXAMPLE_API = 1013; |
90 |
IB_EXAMPLE_DB = 1014; |
91 |
IB_DEV = 1015; |
92 |
|
93 |
IB_CONNECTIVITY_SERVER = 1100; |
94 |
IB_CONNECTIVITY = 1101; |
95 |
IB_ODBC_CLIENT = 1102; |
96 |
IB_JDBC_CLIENT = 1103; |
97 |
IB_OLEDB_CLIENT = 1104; |
98 |
|
99 |
{ Error and warning codes } |
100 |
isc_install_optlist_empty = -1; |
101 |
isc_install_actlist_empty = -2; |
102 |
isc_install_fp_copy_delayed = -3; |
103 |
isc_install_fp_delete_delayed = -4; |
104 |
isc_install_option_not_found = -5; |
105 |
isc_install_msg_version = -6; |
106 |
isc_install_cant_load_msg = -7; |
107 |
isc_install_invalid_msg = -8; |
108 |
isc_install_invalid_tbl = -9; |
109 |
isc_install_cant_create_msg = -10; |
110 |
isc_install_handle_not_allocated = -11; |
111 |
isc_install_odbc_comp_notfound = -12; |
112 |
isc_install_cant_delete = -13; |
113 |
isc_install_cant_rmdir = -14; |
114 |
isc_install_key_nonempty = -15; |
115 |
|
116 |
isc_install_success = 0; |
117 |
|
118 |
{ File and directory related errors } |
119 |
isc_install_file_error = isc_install_success; |
120 |
isc_install_path_not_valid = isc_install_file_error+1; |
121 |
isc_install_path_not_exists = isc_install_file_error+2; |
122 |
isc_install_cant_write = isc_install_file_error+3; |
123 |
isc_install_type_unknown = isc_install_file_error+4; |
124 |
isc_install_cant_move_file = isc_install_file_error+5; |
125 |
isc_install_device_not_valid = isc_install_file_error+6; |
126 |
isc_install_data_truncated = isc_install_file_error+7; |
127 |
isc_install_cant_get_temp = isc_install_file_error+8; |
128 |
isc_install_no_file = isc_install_file_error+9; |
129 |
isc_install_cant_load_lib = isc_install_file_error+10; |
130 |
isc_install_cant_lookup_lib = isc_install_file_error+11; |
131 |
isc_install_file_exists = isc_install_file_error+12; |
132 |
isc_install_cant_open_log = isc_install_file_error+13; |
133 |
isc_install_write_error = isc_install_file_error+14; |
134 |
isc_install_read_error = isc_install_file_error+15; |
135 |
isc_install_invalid_log = isc_install_file_error+16; |
136 |
isc_install_cant_read = isc_install_file_error+17; |
137 |
isc_install_no_diskspace = isc_install_file_error+18; |
138 |
isc_install_cant_create_dir = isc_install_file_error+19; |
139 |
isc_install_msg_syntax = isc_install_file_error+20; |
140 |
isc_install_fp_delete_error = isc_install_file_error+21; |
141 |
isc_install_fp_rename_error = isc_install_file_error+22; |
142 |
isc_install_fp_copy_error = isc_install_file_error+23; |
143 |
|
144 |
{ Precheck related errors } |
145 |
isc_install_precheck_error = isc_install_file_error+24; |
146 |
isc_install_system_not_supported = isc_install_precheck_error; |
147 |
isc_install_server_running = isc_install_precheck_error+1; |
148 |
isc_install_classic_found = isc_install_precheck_error+2; |
149 |
isc_install_no_privileges = isc_install_precheck_error+3; |
150 |
isc_install_cant_get_free_space = isc_install_precheck_error+4; |
151 |
isc_install_guardian_running = isc_install_precheck_error+5; |
152 |
isc_install_invalid_option = isc_install_precheck_error+6; |
153 |
isc_install_invalid_handle = isc_install_precheck_error+7; |
154 |
isc_install_message_not_found = isc_install_precheck_error+8; |
155 |
|
156 |
{ TCP/IP services related } |
157 |
isc_install_ip_error = isc_install_precheck_error+9; |
158 |
isc_install_no_stack = isc_install_ip_error; |
159 |
isc_install_cant_add_service = isc_install_ip_error+1; |
160 |
isc_install_invalid_port = isc_install_ip_error+2; |
161 |
isc_install_invalid_service = isc_install_ip_error+3; |
162 |
isc_install_no_proto = isc_install_ip_error+4; |
163 |
isc_install_no_services_entry = isc_install_ip_error+5; |
164 |
isc_install_sock_error = isc_install_ip_error+6; |
165 |
isc_install_conversion_error = isc_install_ip_error+7; |
166 |
|
167 |
|
168 |
{ Operations errors } |
169 |
isc_install_op_error = isc_install_ip_error+8; |
170 |
isc_install_cant_copy = isc_install_op_error; |
171 |
isc_install_no_mem = isc_install_op_error+1; |
172 |
isc_install_queue_failed = isc_install_op_error+2; |
173 |
isc_install_invalid_param = isc_install_op_error+3; |
174 |
isc_install_fp_error_exception = isc_install_op_error+4; |
175 |
isc_install_fp_status_exception = isc_install_op_error+5; |
176 |
isc_install_user_aborted = isc_install_op_error+6; |
177 |
|
178 |
{ Registry related errors } |
179 |
isc_install_reg_error = isc_install_op_error+7; |
180 |
isc_install_key_exists = isc_install_reg_error; |
181 |
isc_install_cant_create_key = isc_install_reg_error+1; |
182 |
isc_install_cant_set_value = isc_install_reg_error+2; |
183 |
isc_install_cant_open_key = isc_install_reg_error+3; |
184 |
isc_install_cant_delete_key = isc_install_reg_error+4; |
185 |
isc_install_cant_query_key = isc_install_reg_error+5; |
186 |
isc_install_cant_delete_value = isc_install_reg_error+6; |
187 |
|
188 |
{ OS services related errors } |
189 |
isc_install_serv_error = isc_install_reg_error+7; |
190 |
isc_install_service_existed = isc_install_serv_error; |
191 |
isc_install_cant_create_service = isc_install_serv_error+1; |
192 |
isc_install_cant_open_service = isc_install_serv_error+2; |
193 |
isc_install_cant_query_service = isc_install_serv_error+3; |
194 |
isc_install_service_running = isc_install_serv_error+4; |
195 |
isc_install_cant_delete_service = isc_install_serv_error+5; |
196 |
isc_install_cant_open_manager = isc_install_serv_error+6; |
197 |
isc_install_system_error = isc_install_serv_error+7; |
198 |
isc_install_com_regfail = isc_install_serv_error+8; |
199 |
isc_install_dcom_required = isc_install_serv_error+9; |
200 |
|
201 |
{ ODBC installation errors } |
202 |
isc_install_odbc_error = isc_install_serv_error+10; |
203 |
isc_install_odbc_general = isc_install_odbc_error; |
204 |
isc_install_core_version = isc_install_odbc_error+1; |
205 |
isc_install_drv_version = isc_install_odbc_error+2; |
206 |
isc_install_tran_version = isc_install_odbc_error+3; |
207 |
|
208 |
type |
209 |
Tisc_install_clear_options = function(hOption: POPTIONS_HANDLE):MSG_NO; |
210 |
stdcall; |
211 |
|
212 |
Tisc_install_execute = function (hOption: OPTIONS_HANDLE; |
213 |
src_dir: TEXT; |
214 |
dest_dir: TEXT; |
215 |
status_func: FP_STATUS; |
216 |
status_data: pointer; |
217 |
error_func: FP_ERROR; |
218 |
error_data: pointer; |
219 |
uninstal_file_name: TEXT):MSG_NO; |
220 |
stdcall; |
221 |
|
222 |
Tisc_install_get_info = function (info_type :integer; |
223 |
option :OPT; |
224 |
info_buffer : Pointer; |
225 |
buf_len : Cardinal): MSG_NO; |
226 |
stdcall; |
227 |
|
228 |
|
229 |
|
230 |
Tisc_install_get_message = function (hOption: OPTIONS_HANDLE; |
231 |
message_no: MSG_NO; |
232 |
message_txt: Pointer; |
233 |
message_len: Cardinal):MSG_NO; |
234 |
stdcall; |
235 |
|
236 |
Tisc_install_load_external_text = function (msg_file_name: TEXT):MSG_NO; |
237 |
stdcall; |
238 |
|
239 |
Tisc_install_precheck = function (hOption: OPTIONS_HANDLE; |
240 |
src_dir: TEXT; |
241 |
dest_dir: TEXT):MSG_NO; |
242 |
stdcall; |
243 |
|
244 |
Tisc_install_set_option = function (hOption: POPTIONS_HANDLE; |
245 |
option: OPT):MSG_NO; |
246 |
stdcall; |
247 |
|
248 |
Tisc_uninstall_execute = function (uninstall_file_name: TEXT; |
249 |
status_func: FP_STATUS; |
250 |
status_data: pointer; |
251 |
error_func: FP_ERROR; |
252 |
error_data: pointer):MSG_NO; |
253 |
stdcall; |
254 |
|
255 |
Tisc_uninstall_precheck = function (uninstall_file_name: TEXT):MSG_NO; |
256 |
stdcall; |
257 |
|
258 |
Tisc_install_unset_option = function (hOption: POPTIONS_HANDLE; |
259 |
option: OPT):MSG_NO; |
260 |
stdcall; |
261 |
implementation |
262 |
|
263 |
|
264 |
{ EXECute ....check of Install mode and call Install_execute or unistall_execute } |
265 |
{ raise an exception on error from the dll } |
266 |
{ call the onWarning handler on warning from DLL } |
267 |
{ GetSpaceAvailable -- call isc_install_get_info function } |
268 |
end. |