3096 |
12 Feb 09 |
olle |
1 |
@echo off |
3096 |
12 Feb 09 |
olle |
2 |
rem |
3096 |
12 Feb 09 |
olle |
rem update_proteios-win.bat |
3096 |
12 Feb 09 |
olle |
4 |
rem |
3096 |
12 Feb 09 |
olle |
5 |
|
3096 |
12 Feb 09 |
olle |
rem Copyright (C) 2009 Olle Mansson |
3096 |
12 Feb 09 |
olle |
7 |
rem |
3096 |
12 Feb 09 |
olle |
rem Files are copyright by their respective authors. The contributions to |
3096 |
12 Feb 09 |
olle |
rem files where copyright is not explicitly stated can be traced with the |
3096 |
12 Feb 09 |
olle |
rem source code revision system. |
3096 |
12 Feb 09 |
olle |
11 |
rem |
3096 |
12 Feb 09 |
olle |
rem This file is part of Proteios. |
3096 |
12 Feb 09 |
olle |
rem Available at http://www.proteios.org/ |
3096 |
12 Feb 09 |
olle |
14 |
rem |
3096 |
12 Feb 09 |
olle |
rem Proteios is free software; you can redistribute it and/or |
3096 |
12 Feb 09 |
olle |
rem modify it under the terms of the GNU General Public License |
3096 |
12 Feb 09 |
olle |
rem as published by the Free Software Foundation; either version 2 |
3096 |
12 Feb 09 |
olle |
rem of the License, or (at your option) any later version. |
3096 |
12 Feb 09 |
olle |
19 |
rem |
3096 |
12 Feb 09 |
olle |
rem Proteios is distributed in the hope that it will be useful, |
3096 |
12 Feb 09 |
olle |
rem but WITHOUT ANY WARRANTY, without even the implied warranty of |
3096 |
12 Feb 09 |
olle |
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3096 |
12 Feb 09 |
olle |
rem GNU General Public License for more details. |
3096 |
12 Feb 09 |
olle |
24 |
rem |
3096 |
12 Feb 09 |
olle |
rem You should have received a copy of the GNU General Public License |
3096 |
12 Feb 09 |
olle |
rem along with this program; if not, write to the Free Software |
3096 |
12 Feb 09 |
olle |
rem Foundation, Inc., 59 Temple Place - Suite 330, |
3096 |
12 Feb 09 |
olle |
rem Boston, MA 02111-1307, USA. |
3096 |
12 Feb 09 |
olle |
29 |
|
3096 |
12 Feb 09 |
olle |
30 |
rem |
3096 |
12 Feb 09 |
olle |
rem Performs Proteios 2.x update on Microsoft Windows. |
3096 |
12 Feb 09 |
olle |
32 |
rem |
3096 |
12 Feb 09 |
olle |
rem Uses bat file inp2var.bat to store console input data |
3096 |
12 Feb 09 |
olle |
rem into a given variable. |
3096 |
12 Feb 09 |
olle |
35 |
rem |
3096 |
12 Feb 09 |
olle |
rem Usage: inp2var.bat var_name [promptfile [mask_input|no_input]] |
3096 |
12 Feb 09 |
olle |
37 |
rem |
3096 |
12 Feb 09 |
olle |
rem Used programs/files: |
3096 |
12 Feb 09 |
olle |
39 |
rem |
3096 |
12 Feb 09 |
olle |
rem inp2var.bat |
3096 |
12 Feb 09 |
olle |
rem inp2var.jar |
3096 |
12 Feb 09 |
olle |
42 |
rem |
3096 |
12 Feb 09 |
olle |
43 |
|
3096 |
12 Feb 09 |
olle |
44 |
rem |
3096 |
12 Feb 09 |
olle |
rem Configuration |
3096 |
12 Feb 09 |
olle |
46 |
rem |
3096 |
12 Feb 09 |
olle |
47 |
set app_name=proteios |
3096 |
12 Feb 09 |
olle |
48 |
set build_dir=www\WEB-INF\classes |
3096 |
12 Feb 09 |
olle |
49 |
rem |
3096 |
12 Feb 09 |
olle |
rem End Configuration |
3096 |
12 Feb 09 |
olle |
51 |
rem |
3096 |
12 Feb 09 |
olle |
52 |
|
3096 |
12 Feb 09 |
olle |
53 |
rem |
3096 |
12 Feb 09 |
olle |
rem Welcome message and update references |
3096 |
12 Feb 09 |
olle |
55 |
rem |
3096 |
12 Feb 09 |
olle |
56 |
echo. |
3096 |
12 Feb 09 |
olle |
57 |
echo. |
3096 |
12 Feb 09 |
olle |
58 |
echo Welcome to the %app_name% update routine. |
3096 |
12 Feb 09 |
olle |
59 |
echo. |
3096 |
12 Feb 09 |
olle |
60 |
echo. |
3096 |
12 Feb 09 |
olle |
61 |
echo It is assumed that %app_name% is already installed. |
3096 |
12 Feb 09 |
olle |
62 |
echo. |
3096 |
12 Feb 09 |
olle |
63 |
echo For more information on the installation steps, see: |
3096 |
12 Feb 09 |
olle |
64 |
echo http://www.proteios.org/wiki/Update |
3096 |
12 Feb 09 |
olle |
65 |
echo. |
3096 |
12 Feb 09 |
olle |
66 |
|
3096 |
12 Feb 09 |
olle |
67 |
rem |
3096 |
12 Feb 09 |
olle |
rem Try to copy configuration files from previous Tomcat installation. |
3096 |
12 Feb 09 |
olle |
69 |
rem |
3096 |
12 Feb 09 |
olle |
70 |
:step_1a |
3096 |
12 Feb 09 |
olle |
71 |
set body_text=1. Trying to copy configuration files from previous Tomcat installation. |
3096 |
12 Feb 09 |
olle |
72 |
set next_step=step_1b |
3096 |
12 Feb 09 |
olle |
73 |
goto print |
3096 |
12 Feb 09 |
olle |
74 |
:step_1b |
3096 |
12 Feb 09 |
olle |
75 |
echo. |
3096 |
12 Feb 09 |
olle |
76 |
|
3096 |
12 Feb 09 |
olle |
77 |
rem |
3096 |
12 Feb 09 |
olle |
78 |
rem |
3096 |
12 Feb 09 |
olle |
rem Set variable catalina_home (tomcat installation directory) |
3096 |
12 Feb 09 |
olle |
80 |
rem |
3096 |
12 Feb 09 |
olle |
rem set catalina_home= |
3096 |
12 Feb 09 |
olle |
82 |
if not "%catalina_home%"=="" goto catalina_ok |
3096 |
12 Feb 09 |
olle |
83 |
echo Catalina home: > prompt.txt |
3096 |
12 Feb 09 |
olle |
84 |
call inp2var.bat catalina_home prompt.txt |
3096 |
12 Feb 09 |
olle |
rem echo catalina_home = %catalina_home% |
3096 |
12 Feb 09 |
olle |
86 |
:catalina_ok |
3096 |
12 Feb 09 |
olle |
87 |
set catalina_inst_dir=%catalina_home%\webapps\%app_name%\WEB-INF\classes |
3096 |
12 Feb 09 |
olle |
88 |
echo. |
3096 |
12 Feb 09 |
olle |
89 |
|
3096 |
12 Feb 09 |
olle |
90 |
rem |
3096 |
12 Feb 09 |
olle |
rem Store current directory in variable %here% |
3096 |
12 Feb 09 |
olle |
92 |
rem |
3096 |
12 Feb 09 |
olle |
93 |
cd > prompt.txt |
3096 |
12 Feb 09 |
olle |
94 |
call inp2var.bat here prompt.txt no_input |
3096 |
12 Feb 09 |
olle |
95 |
|
3096 |
12 Feb 09 |
olle |
96 |
rem |
3096 |
12 Feb 09 |
olle |
rem Try to copy configuration files from previous Tomcat installation. |
3096 |
12 Feb 09 |
olle |
98 |
rem |
3096 |
12 Feb 09 |
olle |
99 |
|
3096 |
12 Feb 09 |
olle |
100 |
set filename=proteios.config |
3096 |
12 Feb 09 |
olle |
101 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
102 |
set next_step=step_1c1 |
3096 |
12 Feb 09 |
olle |
103 |
goto copy_file_from_tomcat_installation |
3096 |
12 Feb 09 |
olle |
104 |
:step_1c1 |
3096 |
12 Feb 09 |
olle |
105 |
|
3096 |
12 Feb 09 |
olle |
106 |
set filename=web.xml |
3096 |
12 Feb 09 |
olle |
107 |
set rel_path=".." |
3096 |
12 Feb 09 |
olle |
108 |
set next_step=step_1c2 |
3096 |
12 Feb 09 |
olle |
109 |
goto copy_file_from_tomcat_installation |
3096 |
12 Feb 09 |
olle |
110 |
:step_1c2 |
3096 |
12 Feb 09 |
olle |
111 |
|
3096 |
12 Feb 09 |
olle |
112 |
set filename=ftp.properties |
3096 |
12 Feb 09 |
olle |
113 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
114 |
set next_step=step_1c3 |
3096 |
12 Feb 09 |
olle |
115 |
goto copy_file_from_tomcat_installation |
3096 |
12 Feb 09 |
olle |
116 |
:step_1c3 |
3096 |
12 Feb 09 |
olle |
117 |
|
3096 |
12 Feb 09 |
olle |
118 |
set filename=xtandem.properties |
3096 |
12 Feb 09 |
olle |
119 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
120 |
set next_step=step_1c4 |
3096 |
12 Feb 09 |
olle |
121 |
goto copy_file_from_tomcat_installation |
3096 |
12 Feb 09 |
olle |
122 |
:step_1c4 |
3096 |
12 Feb 09 |
olle |
123 |
|
3096 |
12 Feb 09 |
olle |
124 |
set filename=mascot.properties |
3096 |
12 Feb 09 |
olle |
125 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
126 |
set next_step=step_1c5 |
3096 |
12 Feb 09 |
olle |
127 |
goto copy_file_from_tomcat_installation |
3096 |
12 Feb 09 |
olle |
128 |
:step_1c5 |
3096 |
12 Feb 09 |
olle |
129 |
|
3096 |
12 Feb 09 |
olle |
130 |
set filename=omssa.properties |
3096 |
12 Feb 09 |
olle |
131 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
132 |
set next_step=step_1c6 |
3096 |
12 Feb 09 |
olle |
133 |
goto copy_file_from_tomcat_installation |
3096 |
12 Feb 09 |
olle |
134 |
:step_1c6 |
3096 |
12 Feb 09 |
olle |
135 |
|
3096 |
12 Feb 09 |
olle |
136 |
set filename=pike.properties |
3096 |
12 Feb 09 |
olle |
137 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
138 |
set next_step=step_1c7 |
3096 |
12 Feb 09 |
olle |
139 |
goto copy_file_from_tomcat_installation |
3096 |
12 Feb 09 |
olle |
140 |
:step_1c7 |
3096 |
12 Feb 09 |
olle |
141 |
|
4085 |
20 Dec 10 |
olle |
142 |
set filename=msinspect.properties |
3096 |
12 Feb 09 |
olle |
143 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
144 |
set next_step=step_1c8 |
3096 |
12 Feb 09 |
olle |
145 |
goto copy_file_from_tomcat_installation |
3096 |
12 Feb 09 |
olle |
146 |
:step_1c8 |
3096 |
12 Feb 09 |
olle |
147 |
|
4153 |
04 Mar 11 |
olle |
148 |
set filename=openms.properties |
4085 |
20 Dec 10 |
olle |
149 |
set rel_path="." |
4085 |
20 Dec 10 |
olle |
150 |
set next_step=step_1c9 |
4085 |
20 Dec 10 |
olle |
151 |
goto copy_file_from_tomcat_installation |
4085 |
20 Dec 10 |
olle |
152 |
:step_1c9 |
4085 |
20 Dec 10 |
olle |
153 |
|
4153 |
04 Mar 11 |
olle |
154 |
set filename=log4j.properties |
4153 |
04 Mar 11 |
olle |
155 |
set rel_path="." |
4153 |
04 Mar 11 |
olle |
156 |
set next_step=step_1c10 |
4153 |
04 Mar 11 |
olle |
157 |
goto copy_file_from_tomcat_installation |
4153 |
04 Mar 11 |
olle |
158 |
:step_1c10 |
4153 |
04 Mar 11 |
olle |
159 |
|
4551 |
25 Mar 14 |
fredrik |
160 |
set filename=connection.properties |
4551 |
25 Mar 14 |
fredrik |
161 |
set rel_path="." |
4551 |
25 Mar 14 |
fredrik |
162 |
set next_step=step_1c11 |
4551 |
25 Mar 14 |
fredrik |
163 |
goto copy_file_from_tomcat_installation |
4551 |
25 Mar 14 |
fredrik |
164 |
:step_1c11 |
4551 |
25 Mar 14 |
fredrik |
165 |
|
4567 |
28 Apr 15 |
fredrik |
166 |
set filename=dinosaur.properties |
4567 |
28 Apr 15 |
fredrik |
167 |
set rel_path="." |
4567 |
28 Apr 15 |
fredrik |
168 |
set next_step=step_1c12 |
4567 |
28 Apr 15 |
fredrik |
169 |
goto copy_file_from_tomcat_installation |
4567 |
28 Apr 15 |
fredrik |
170 |
:step_1c12 |
4567 |
28 Apr 15 |
fredrik |
171 |
|
4611 |
04 Jul 16 |
fredrik |
172 |
set filename=msgfplus.properties |
4611 |
04 Jul 16 |
fredrik |
173 |
set rel_path="." |
4611 |
04 Jul 16 |
fredrik |
174 |
set next_step=step_1c13 |
4611 |
04 Jul 16 |
fredrik |
175 |
goto copy_file_from_tomcat_installation |
4611 |
04 Jul 16 |
fredrik |
176 |
:step_1c13 |
4611 |
04 Jul 16 |
fredrik |
177 |
|
3096 |
12 Feb 09 |
olle |
178 |
rem |
3096 |
12 Feb 09 |
olle |
rem Check if necessary configuration files exist. |
3096 |
12 Feb 09 |
olle |
180 |
rem |
3096 |
12 Feb 09 |
olle |
181 |
:step_2a |
3096 |
12 Feb 09 |
olle |
182 |
set body_text=2. Checking if necessary configuration files exist. |
3096 |
12 Feb 09 |
olle |
183 |
set next_step=step_2b |
3096 |
12 Feb 09 |
olle |
184 |
goto print |
3096 |
12 Feb 09 |
olle |
185 |
:step_2b |
3096 |
12 Feb 09 |
olle |
186 |
echo. |
3096 |
12 Feb 09 |
olle |
187 |
|
3096 |
12 Feb 09 |
olle |
188 |
set filename=proteios.config |
3096 |
12 Feb 09 |
olle |
189 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
190 |
set next_step=step_2c1 |
3096 |
12 Feb 09 |
olle |
191 |
goto check_if_necessary_configuration_file_exists |
3096 |
12 Feb 09 |
olle |
192 |
:step_2c1 |
3096 |
12 Feb 09 |
olle |
193 |
|
3096 |
12 Feb 09 |
olle |
194 |
set filename=web.xml |
3096 |
12 Feb 09 |
olle |
195 |
set rel_path=".." |
3096 |
12 Feb 09 |
olle |
196 |
set next_step=step_2c2 |
3096 |
12 Feb 09 |
olle |
197 |
goto check_if_necessary_configuration_file_exists |
3096 |
12 Feb 09 |
olle |
198 |
:step_2c2 |
3096 |
12 Feb 09 |
olle |
199 |
|
3096 |
12 Feb 09 |
olle |
200 |
set filename=ftp.properties |
3096 |
12 Feb 09 |
olle |
201 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
202 |
set next_step=step_2c3 |
3096 |
12 Feb 09 |
olle |
203 |
goto check_if_necessary_configuration_file_exists |
3096 |
12 Feb 09 |
olle |
204 |
:step_2c3 |
3096 |
12 Feb 09 |
olle |
205 |
|
3096 |
12 Feb 09 |
olle |
206 |
rem |
3096 |
12 Feb 09 |
olle |
rem Create other configuration files if not existing. |
3096 |
12 Feb 09 |
olle |
208 |
rem |
3096 |
12 Feb 09 |
olle |
209 |
:step_3a |
3096 |
12 Feb 09 |
olle |
210 |
set body_text=3. Create other configuration files if not existing. |
3096 |
12 Feb 09 |
olle |
211 |
set next_step=step_3b |
3096 |
12 Feb 09 |
olle |
212 |
goto print |
3096 |
12 Feb 09 |
olle |
213 |
:step_3b |
3096 |
12 Feb 09 |
olle |
214 |
echo. |
3096 |
12 Feb 09 |
olle |
215 |
|
3096 |
12 Feb 09 |
olle |
216 |
set filename=xtandem.properties |
3096 |
12 Feb 09 |
olle |
217 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
218 |
set file_title="X!Tandem search" |
3096 |
12 Feb 09 |
olle |
219 |
set next_step=step_3c1 |
3096 |
12 Feb 09 |
olle |
220 |
goto create_config_file_if_not_existing |
3096 |
12 Feb 09 |
olle |
221 |
:step_3c1 |
3096 |
12 Feb 09 |
olle |
222 |
|
3096 |
12 Feb 09 |
olle |
223 |
set filename=mascot.properties |
3096 |
12 Feb 09 |
olle |
224 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
225 |
set file_title="Mascot search" |
3096 |
12 Feb 09 |
olle |
226 |
set next_step=step_3c2 |
3096 |
12 Feb 09 |
olle |
227 |
goto create_config_file_if_not_existing |
3096 |
12 Feb 09 |
olle |
228 |
:step_3c2 |
3096 |
12 Feb 09 |
olle |
229 |
|
3096 |
12 Feb 09 |
olle |
230 |
set filename=omssa.properties |
3096 |
12 Feb 09 |
olle |
231 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
232 |
set file_title="OMSSA search" |
3096 |
12 Feb 09 |
olle |
233 |
set next_step=step_3c3 |
3096 |
12 Feb 09 |
olle |
234 |
goto create_config_file_if_not_existing |
3096 |
12 Feb 09 |
olle |
235 |
:step_3c3 |
3096 |
12 Feb 09 |
olle |
236 |
|
3096 |
12 Feb 09 |
olle |
237 |
set filename=pike.properties |
3096 |
12 Feb 09 |
olle |
238 |
set rel_path="." |
3096 |
12 Feb 09 |
olle |
239 |
set file_title="PIKE search" |
3096 |
12 Feb 09 |
olle |
240 |
set next_step=step_3c4 |
3096 |
12 Feb 09 |
olle |
241 |
goto create_config_file_if_not_existing |
3096 |
12 Feb 09 |
olle |
242 |
:step_3c4 |
3096 |
12 Feb 09 |
olle |
243 |
|
4180 |
23 Mar 11 |
olle |
244 |
set filename=msinspect.properties |
3096 |
12 Feb 09 |
olle |
245 |
set rel_path="." |
4180 |
23 Mar 11 |
olle |
246 |
set file_title="msInspect feature detection" |
3096 |
12 Feb 09 |
olle |
247 |
set next_step=step_3c5 |
3096 |
12 Feb 09 |
olle |
248 |
goto create_config_file_if_not_existing |
3096 |
12 Feb 09 |
olle |
249 |
:step_3c5 |
3096 |
12 Feb 09 |
olle |
250 |
|
4181 |
23 Mar 11 |
olle |
251 |
set filename=openms.properties |
4180 |
23 Mar 11 |
olle |
252 |
set rel_path="." |
4181 |
23 Mar 11 |
olle |
253 |
set file_title="OpenMS feature detection" |
4180 |
23 Mar 11 |
olle |
254 |
set next_step=step_3c6 |
4180 |
23 Mar 11 |
olle |
255 |
goto create_config_file_if_not_existing |
4180 |
23 Mar 11 |
olle |
256 |
:step_3c6 |
4180 |
23 Mar 11 |
olle |
257 |
|
4181 |
23 Mar 11 |
olle |
258 |
set filename=log4j.properties |
4181 |
23 Mar 11 |
olle |
259 |
set rel_path="." |
4181 |
23 Mar 11 |
olle |
260 |
set file_title="Log" |
4181 |
23 Mar 11 |
olle |
261 |
set next_step=step_3c7 |
4181 |
23 Mar 11 |
olle |
262 |
goto create_config_file_if_not_existing |
4181 |
23 Mar 11 |
olle |
263 |
:step_3c7 |
4181 |
23 Mar 11 |
olle |
264 |
|
4551 |
25 Mar 14 |
fredrik |
265 |
set filename=connection.properties |
4551 |
25 Mar 14 |
fredrik |
266 |
set rel_path="." |
4551 |
25 Mar 14 |
fredrik |
267 |
set file_title="Connection" |
4551 |
25 Mar 14 |
fredrik |
268 |
set next_step=step_3c8 |
4551 |
25 Mar 14 |
fredrik |
269 |
goto create_config_file_if_not_existing |
4551 |
25 Mar 14 |
fredrik |
270 |
:step_3c8 |
4551 |
25 Mar 14 |
fredrik |
271 |
|
4567 |
28 Apr 15 |
fredrik |
272 |
set filename=dinosaur.properties |
4567 |
28 Apr 15 |
fredrik |
273 |
set rel_path="." |
4567 |
28 Apr 15 |
fredrik |
274 |
set file_title="Dinosaur" |
4567 |
28 Apr 15 |
fredrik |
275 |
set next_step=step_3c9 |
4567 |
28 Apr 15 |
fredrik |
276 |
goto create_config_file_if_not_existing |
4567 |
28 Apr 15 |
fredrik |
277 |
:step_3c9 |
4567 |
28 Apr 15 |
fredrik |
278 |
|
4611 |
04 Jul 16 |
fredrik |
279 |
set filename=msgfplus.properties |
4611 |
04 Jul 16 |
fredrik |
280 |
set rel_path="." |
4611 |
04 Jul 16 |
fredrik |
281 |
set file_title="MSGPplus" |
4611 |
04 Jul 16 |
fredrik |
282 |
set next_step=step_3c10 |
4611 |
04 Jul 16 |
fredrik |
283 |
goto create_config_file_if_not_existing |
4611 |
04 Jul 16 |
fredrik |
284 |
:step_3c10 |
4611 |
04 Jul 16 |
fredrik |
285 |
|
3096 |
12 Feb 09 |
olle |
286 |
rem |
3096 |
12 Feb 09 |
olle |
rem Get Proteios root password |
3096 |
12 Feb 09 |
olle |
288 |
rem |
3096 |
12 Feb 09 |
olle |
289 |
:step_4a |
3096 |
12 Feb 09 |
olle |
290 |
set body_text=4. Enter a password for the root account in %app_name%. |
3096 |
12 Feb 09 |
olle |
291 |
set next_step=step_4b |
3096 |
12 Feb 09 |
olle |
292 |
goto print |
3096 |
12 Feb 09 |
olle |
293 |
:step_4b |
3096 |
12 Feb 09 |
olle |
294 |
echo Password: > prompt.txt |
3096 |
12 Feb 09 |
olle |
295 |
call inp2var.bat root_pwd prompt.txt mask_input |
3096 |
12 Feb 09 |
olle |
296 |
echo. |
3096 |
12 Feb 09 |
olle |
297 |
|
3096 |
12 Feb 09 |
olle |
298 |
rem |
3096 |
12 Feb 09 |
olle |
rem Execute update |
3096 |
12 Feb 09 |
olle |
300 |
rem |
3096 |
12 Feb 09 |
olle |
301 |
|
3096 |
12 Feb 09 |
olle |
302 |
rem |
3096 |
12 Feb 09 |
olle |
rem Build class path |
3096 |
12 Feb 09 |
olle |
304 |
rem |
3096 |
12 Feb 09 |
olle |
305 |
set cp=.\%build_dir% |
3096 |
12 Feb 09 |
olle |
306 |
rem |
3096 |
12 Feb 09 |
olle |
rem Note: Variables like %cp% are interpreted before a for-statement |
3096 |
12 Feb 09 |
olle |
rem is executed, so a for-loop like |
3096 |
12 Feb 09 |
olle |
309 |
rem |
3096 |
12 Feb 09 |
olle |
rem for %%i in (.\www\WEB-INF\lib\*.jar) do set cp=%cp%;%%i |
3096 |
12 Feb 09 |
olle |
311 |
rem |
3096 |
12 Feb 09 |
olle |
rem will only add the last of the *.jar files to the %cp% list |
3096 |
12 Feb 09 |
olle |
rem after the for-loop is finished. This can be solved by calling |
3096 |
12 Feb 09 |
olle |
rem a temporary batch file that updates the %cp% value for each loop. |
3096 |
12 Feb 09 |
olle |
rem The contents of the temporary batch file tmp1.bat is |
3096 |
12 Feb 09 |
olle |
316 |
rem |
3096 |
12 Feb 09 |
olle |
rem set cp=%cp%;%1 |
3096 |
12 Feb 09 |
olle |
318 |
rem |
3096 |
12 Feb 09 |
olle |
rem where %1 is the argument that will be provided by the |
3096 |
12 Feb 09 |
olle |
rem for-loop variable %%i. |
3096 |
12 Feb 09 |
olle |
321 |
rem |
3096 |
12 Feb 09 |
olle |
322 |
echo set cp=%%cp%%;%%1> tmp1.bat |
3096 |
12 Feb 09 |
olle |
323 |
for %%i in (.\www\WEB-INF\lib\*.jar) do call tmp1.bat %%i |
3096 |
12 Feb 09 |
olle |
324 |
del tmp1.bat |
3096 |
12 Feb 09 |
olle |
325 |
|
3096 |
12 Feb 09 |
olle |
326 |
rem |
3096 |
12 Feb 09 |
olle |
rem Update database. |
3096 |
12 Feb 09 |
olle |
328 |
rem |
3096 |
12 Feb 09 |
olle |
329 |
java -cp %cp% org.proteios.install.InitDB update %root_pwd% |
3096 |
12 Feb 09 |
olle |
330 |
|
3096 |
12 Feb 09 |
olle |
331 |
rem |
3096 |
12 Feb 09 |
olle |
rem Create link in tomcat webapps directory to proteomics directory |
3096 |
12 Feb 09 |
olle |
333 |
rem |
3096 |
12 Feb 09 |
olle |
334 |
|
3096 |
12 Feb 09 |
olle |
335 |
rem |
3096 |
12 Feb 09 |
olle |
rem Store current directory in variable %here% |
3096 |
12 Feb 09 |
olle |
337 |
rem |
3096 |
12 Feb 09 |
olle |
338 |
cd > prompt.txt |
3096 |
12 Feb 09 |
olle |
339 |
call inp2var.bat here prompt.txt no_input |
3096 |
12 Feb 09 |
olle |
340 |
echo Deploying %app_name% into %catalina_home% |
3096 |
12 Feb 09 |
olle |
341 |
echo ________________________________________________________________________ |
3096 |
12 Feb 09 |
olle |
342 |
echo. |
3546 |
18 Jan 10 |
fredrik |
343 |
echo Copying new installation from %here%\www to %catalina_home%\webapps\www. |
3546 |
18 Jan 10 |
fredrik |
344 |
xcopy "%here%"\www "%catalina_home%"\webapps\www /E /I /V /Q |
3546 |
18 Jan 10 |
fredrik |
345 |
if ERRORLEVEL 1 goto failure |
3546 |
18 Jan 10 |
fredrik |
346 |
echo Removing old installation. |
3546 |
18 Jan 10 |
fredrik |
347 |
rmdir "%catalina_home%"\webapps\%app_name% /S /Q |
3546 |
18 Jan 10 |
fredrik |
348 |
if ERRORLEVEL 1 goto failure |
3546 |
18 Jan 10 |
fredrik |
349 |
echo Activating new installation in %catalina_home%\webapps\%app_name%. |
3546 |
18 Jan 10 |
fredrik |
350 |
move "%catalina_home%"\webapps\www "%catalina_home%"\webapps\%app_name% |
3546 |
18 Jan 10 |
fredrik |
351 |
if ERRORLEVEL 1 goto failure |
3096 |
12 Feb 09 |
olle |
352 |
|
3096 |
12 Feb 09 |
olle |
353 |
rem |
3096 |
12 Feb 09 |
olle |
rem Print finishing remarks |
3096 |
12 Feb 09 |
olle |
355 |
rem |
3096 |
12 Feb 09 |
olle |
356 |
:step_5a |
3546 |
18 Jan 10 |
fredrik |
357 |
set body_text=%app_name% is now updated. Restart tomcat before use. |
3096 |
12 Feb 09 |
olle |
358 |
set next_step=step_5b |
3096 |
12 Feb 09 |
olle |
359 |
goto print |
3096 |
12 Feb 09 |
olle |
360 |
:step_5b |
3096 |
12 Feb 09 |
olle |
361 |
echo. |
3096 |
12 Feb 09 |
olle |
362 |
echo. |
3096 |
12 Feb 09 |
olle |
363 |
|
3096 |
12 Feb 09 |
olle |
364 |
goto finish |
3096 |
12 Feb 09 |
olle |
365 |
|
3096 |
12 Feb 09 |
olle |
366 |
|
3096 |
12 Feb 09 |
olle |
367 |
:print |
3096 |
12 Feb 09 |
olle |
368 |
rem |
3096 |
12 Feb 09 |
olle |
rem Subroutine print |
3096 |
12 Feb 09 |
olle |
370 |
rem |
3096 |
12 Feb 09 |
olle |
rem Prints header text for current step. |
3096 |
12 Feb 09 |
olle |
372 |
rem |
3096 |
12 Feb 09 |
olle |
rem Argument %body_text%: String to print |
3096 |
12 Feb 09 |
olle |
rem Argument %next_step%: Return label when finished |
3096 |
12 Feb 09 |
olle |
375 |
rem |
3096 |
12 Feb 09 |
olle |
376 |
echo. |
3096 |
12 Feb 09 |
olle |
377 |
echo. |
3096 |
12 Feb 09 |
olle |
378 |
echo %body_text% |
3096 |
12 Feb 09 |
olle |
379 |
echo. |
3096 |
12 Feb 09 |
olle |
380 |
goto %next_step% |
3096 |
12 Feb 09 |
olle |
381 |
|
3096 |
12 Feb 09 |
olle |
382 |
|
3096 |
12 Feb 09 |
olle |
383 |
:copy_file_from_tomcat_installation |
3096 |
12 Feb 09 |
olle |
384 |
rem |
3096 |
12 Feb 09 |
olle |
rem Subroutine copy_file_from_tomcat_installation |
3096 |
12 Feb 09 |
olle |
386 |
rem |
3096 |
12 Feb 09 |
olle |
rem Argument %filename%: Name of file to copy |
3096 |
12 Feb 09 |
olle |
rem Argument %rel_path%: Directory path relative to WEB-INF\classes\ directory |
3096 |
12 Feb 09 |
olle |
rem Argument %next_step%: Return label when finished |
3096 |
12 Feb 09 |
olle |
390 |
rem |
3096 |
12 Feb 09 |
olle |
391 |
cd %build_dir%\%rel_path% |
3096 |
12 Feb 09 |
olle |
392 |
if exist "%catalina_inst_dir%\%rel_path%\%filename%" goto tomcat_config_file_ok |
3096 |
12 Feb 09 |
olle |
393 |
echo No configuration file %filename% to copy from previous Tomcat installation. |
3096 |
12 Feb 09 |
olle |
394 |
goto tomcat_config_file_end |
3096 |
12 Feb 09 |
olle |
395 |
:tomcat_config_file_ok |
3096 |
12 Feb 09 |
olle |
396 |
echo Copying file %filename% from previous Tomcat installation. |
3096 |
12 Feb 09 |
olle |
397 |
copy "%catalina_inst_dir%\%rel_path%\%filename%" %filename% |
3096 |
12 Feb 09 |
olle |
398 |
:tomcat_config_file_end |
3096 |
12 Feb 09 |
olle |
399 |
cd %here% |
3096 |
12 Feb 09 |
olle |
400 |
goto %next_step% |
3096 |
12 Feb 09 |
olle |
401 |
|
3096 |
12 Feb 09 |
olle |
402 |
|
3096 |
12 Feb 09 |
olle |
403 |
:check_if_necessary_configuration_file_exists |
3096 |
12 Feb 09 |
olle |
404 |
rem |
3096 |
12 Feb 09 |
olle |
rem Subroutine check_if_necessary_configuration_file_exists |
3096 |
12 Feb 09 |
olle |
406 |
rem |
3096 |
12 Feb 09 |
olle |
rem Argument %filename%: Name of file to check |
3096 |
12 Feb 09 |
olle |
rem Argument %rel_path%: Directory path relative to WEB-INF\classes\ directory |
3096 |
12 Feb 09 |
olle |
rem Argument %next_step%: Return label when finished |
3096 |
12 Feb 09 |
olle |
410 |
rem |
3096 |
12 Feb 09 |
olle |
411 |
cd %build_dir%\%rel_path% |
3096 |
12 Feb 09 |
olle |
412 |
if exist %filename% goto necessary_config_file_ok |
3096 |
12 Feb 09 |
olle |
413 |
echo Configuration file %filename% missing - Use installation script instead. |
3096 |
12 Feb 09 |
olle |
414 |
goto finish |
3096 |
12 Feb 09 |
olle |
415 |
:necessary_config_file_ok |
3096 |
12 Feb 09 |
olle |
416 |
echo Configuration file %filename% exists - OK. |
3096 |
12 Feb 09 |
olle |
417 |
cd %here% |
3096 |
12 Feb 09 |
olle |
418 |
goto %next_step% |
3096 |
12 Feb 09 |
olle |
419 |
|
3096 |
12 Feb 09 |
olle |
420 |
|
3096 |
12 Feb 09 |
olle |
421 |
:create_config_file_if_not_existing |
3096 |
12 Feb 09 |
olle |
422 |
rem |
3096 |
12 Feb 09 |
olle |
rem Subroutine create_config_file_if_not_existing |
3096 |
12 Feb 09 |
olle |
424 |
rem |
3096 |
12 Feb 09 |
olle |
rem Argument %filename%: Name of file to create |
3096 |
12 Feb 09 |
olle |
rem Argument %rel_path%: Directory path relative to WEB-INF\classes\ directory |
3096 |
12 Feb 09 |
olle |
rem Argument %file_title%: file title |
3096 |
12 Feb 09 |
olle |
rem Argument %next_step%: Return label when finished |
3096 |
12 Feb 09 |
olle |
429 |
rem |
3096 |
12 Feb 09 |
olle |
430 |
cd %build_dir%\%rel_path% |
3096 |
12 Feb 09 |
olle |
431 |
if exist %filename% goto config_file_ok |
3096 |
12 Feb 09 |
olle |
432 |
echo Creating %file_title% config file %fileanme% ... |
3096 |
12 Feb 09 |
olle |
433 |
copy %filename%.in %filename% |
3096 |
12 Feb 09 |
olle |
434 |
goto config_file_end |
3096 |
12 Feb 09 |
olle |
435 |
:config_file_ok |
3096 |
12 Feb 09 |
olle |
436 |
echo %file_title% config file %filename% exists - OK. |
3096 |
12 Feb 09 |
olle |
437 |
:config_file_end |
3096 |
12 Feb 09 |
olle |
438 |
cd %here% |
3096 |
12 Feb 09 |
olle |
439 |
goto %next_step% |
3096 |
12 Feb 09 |
olle |
440 |
|
3546 |
18 Jan 10 |
fredrik |
441 |
:failure |
3546 |
18 Jan 10 |
fredrik |
442 |
echo Installation failed |
3546 |
18 Jan 10 |
fredrik |
443 |
goto finish |
3096 |
12 Feb 09 |
olle |
444 |
|
3546 |
18 Jan 10 |
fredrik |
445 |
|
3096 |
12 Feb 09 |
olle |
446 |
:finish |
3096 |
12 Feb 09 |
olle |
447 |
rem |
3096 |
12 Feb 09 |
olle |
rem Clear used environment variables |
3096 |
12 Feb 09 |
olle |
449 |
rem |
3096 |
12 Feb 09 |
olle |
450 |
rem |
3096 |
12 Feb 09 |
olle |
rem Remove values of used batch file parameters, |
3096 |
12 Feb 09 |
olle |
rem so they cannot be accessed from the command line. |
3096 |
12 Feb 09 |
olle |
453 |
rem |
3096 |
12 Feb 09 |
olle |
454 |
set app_name= |
3096 |
12 Feb 09 |
olle |
455 |
set build_dir= |
3096 |
12 Feb 09 |
olle |
456 |
set root_pwd= |
3096 |
12 Feb 09 |
olle |
457 |
set cp= |
3096 |
12 Feb 09 |
olle |
458 |
set body_text= |
3096 |
12 Feb 09 |
olle |
459 |
set next_step= |
3096 |
12 Feb 09 |
olle |
460 |
set here= |
3546 |
18 Jan 10 |
fredrik |
461 |
|
3546 |
18 Jan 10 |
fredrik |
462 |
echo Press Enter to finish: > prompt.txt |
3546 |
18 Jan 10 |
fredrik |
463 |
call inp2var.bat dummy_var prompt.txt |
3096 |
12 Feb 09 |
olle |
464 |
:end |