source: main/trunk/release-kits/kits/rk3/installer/build.xml@ 23836

Last change on this file since 23836 was 23836, checked in by sjm84, 13 years ago

Updated the Windows start menu uninstaller link to point to the correct location

File size: 14.1 KB
Line 
1<?xml version="1.0"?>
2<!--
3This is the build.xml run by AntInstaller for the installer
4-->
5<project name="Installation">
6
7 <!-- this is required to pick up the properties generated during the install pages -->
8 <property file="${basedir}/ant.install.properties"/>
9
10 <!-- custom tasks -->
11 <path id="project.classpath"><pathelement path="${antinstaller.jar}"/></path>
12
13 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
14 <!-- if linux|mac -->
15 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
16 <!-- /if -->
17 <!-- if windows -->
18 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
19 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
20 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
21 <!-- /if -->
22
23 <!-- create a local and strictly unix installDir String -->
24 <path id="installDir.path"><pathelement location="${installDir}"/></path>
25 <property name="installDir.local" refid="installDir.path"/>
26 <pathconvert targetos="unix" property="installDir.unix" refid="installDir.path"/>
27
28 <!-- if windows -->
29 <!-- load windows properties -->
30 <winprops/>
31 <!-- /if -->
32
33 <!-- work out whether a jre is bundled with this installer -->
34 <available file="../jre/bin" property="bundled.java.exists"/>
35
36 <!-- determine if there is an existing installation in the installDir-->
37 <available file="${installDir}\installation.properties" property="is.overinstall"/>
38
39 <!-- target to copy the bundled jre into place -->
40 <target name="Initialising" if="bundled.java.exists">
41 <mkdir dir="${installDir}"/>
42 <copy todir="${installDir}/packages/jre" failonerror="false">
43 <fileset dir="../jre"/>
44 </copy>
45 <chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>
46 </target>
47
48 <!-- target to load in the messages left by the last installation -->
49 <target name="Looking For Previous Installation" if="is.overinstall">
50 <property file="${installDir}\installation.properties"/>
51 <delete dir="${installed.startmenu.path}" failonerror="false"/>
52 </target>
53
54 <target name="Installing Core System">
55
56 <!-- rip out build.xml to the temp dir so we can fake and <antcall> with <ant> -->
57 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="build.xml"/></patternset></unzip>
58
59
60 <!-- if windows -->
61 <echo>Figuring out the start menu path</echo>
62 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
63 <path id="startmenu.path.path" path="${startmenu.path}"/>
64 <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
65
66 <echo>Extracting 7za tool</echo>
67 <unzip src="${antinstaller.jar}" dest="${basedir}">
68 <patternset><include name="7za.exe"/></patternset>
69 </unzip>
70 <!-- /if -->
71
72 <echo>Extracting core component</echo>
73 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
74 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec><!-- /if -->
75 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/><!-- /if -->
76 <delete file="core.lzma"/>
77 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
78 <delete file="core.comp"/>
79
80 <echo>Setting binaries to executable</echo>
81 <chmod dir="${installDir}" includes="*.sh" perm="775"/>
82 <chmod dir="${installDir}/bin/script" includes="*" perm="775"/>
83 <chmod dir="${installDir}/bin" includes="*" perm="775"/>
84 <!-- if linux -->
85 <chmod dir="${installDir}/gs2build/bin/linux" includes="*" perm="775"/>
86 <!-- /if -->
87 <!-- if mac -->
88 <chmod dir="${installDir}/gs2build/bin/darwin" includes="*" perm="775"/>
89 <!-- /if -->
90 <chmod dir="${installDir}/gs2build/bin/script" includes="**/*" perm="775"/>
91 <!-- GLI START -->
92 <chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
93 <!-- GLI END -->
94
95 <!--<chmod file="${installDir}/packages/ant/bin/ant" perm="775"/>-->
96 <!--
97 source is not included for now
98 <chmod dir="${installDir}/gs2build" includes="**/configure" perm="775"/>
99 <chmod dir="${installDir}/gs2build/common-src/packages/gdbm/gdbm-1.8.3" includes="mkinstalldirs" perm="775"/>
100 <chmod file="${installDir}/src/packages/javagdbm/configure" perm="775"/>
101 -->
102
103 <echo>Setting tomcat ports</echo>
104 <rsr file="${installDir}/build.properties">
105 <job pattern="^(tomcat\.server[=:]).*" replacement="$1${tomcat.server}" />
106 <job pattern="^(tomcat\.port[=:]).*" replacement="$1${tomcat.port}" />
107 <job pattern="^(tomcat\.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
108 </rsr>
109
110 <echo>Setting up global properties</echo>
111 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
112 <rsr file="${installDir}/web/WEB-INF/classes/global.properties">
113 <job pattern="^(gsdl3\.home[:=]).*" replacement="$1${installDir.unix}/web" />
114 <job pattern="^(tomcat.server[:=]).*" replacement="$1${tomcat.server}" />
115 <job pattern="^(tomcat\.port[:=]).*" replacement="$1${tomcat.port}" />
116 </rsr>
117
118 <echo>Setting up log4j properties</echo>
119 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
120 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.unix}/web" />
121
122 <!-- if windows -->
123 <echo message="Setting GSDLHOME in gs2build\setup.bat"/>
124 <!-- No quotes around GSDLHOME filepath in setup.bat. since the set operations of batchfiles don't want spaces in their assignments, and where quotes are needed in setup.bat, setup.bat handles this itself -->
125 <rsr file="${installDir}/gs2build/setup.bat" pattern="&quot;?\*\*GSDLHOME\*\*&quot;?" replacement="${installDir.local}\gs2build" />
126 <!-- /if -->
127
128 <!-- GLI START -->
129 <echo>Creating the english dictionary</echo>
130 <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
131 <!-- GLI END -->
132
133 <echo>Creating usage.txt</echo>
134 <echo file="${installDir}/gs2build/etc/usage.txt"></echo>
135
136 <echo>Creating installation properties file</echo>
137 <echo file="${installDir}\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
138
139 <echo>Finished</echo>
140
141 </target>
142
143 <target name="Installing ImageMagick">
144
145 <echo>Installing ImageMagick</echo>
146 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
147 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec><!-- /if -->
148 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/><!-- /if -->
149 <delete file="imagemagick.lzma"/>
150 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}"/>
151 <delete file="imagemagick.comp"/>
152
153 <echo>Setting binaries to executable</echo>
154 <!-- if linux -->
155 <chmod dir="${installDir}/gs2build/bin/linux/imagemagick/bin" includes="*" perm="775"/>
156 <!-- /if -->
157 <!-- if mac -->
158 <chmod dir="${installDir}/gs2build/bin/darwin/imagemagick/bin" includes="*" perm="775"/>
159 <!-- /if -->
160
161 </target>
162
163 <target name="Installing Ghostscript">
164
165 <echo>Installing Ghostscript</echo>
166 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
167 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec><!-- /if -->
168 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/><!-- /if -->
169 <delete file="ghostscript.lzma"/>
170 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}"/>
171 <delete file="ghostscript.comp"/>
172
173 <echo>Setting binaries to executable</echo>
174 <!-- if linux -->
175 <chmod dir="${installDir}/gs2build/bin/linux/ghostscript/bin" includes="*" perm="775"/>
176 <!-- /if -->
177 <!-- if mac -->
178 <chmod dir="${installDir}/gs2build/bin/darwin/ghostscript/bin" includes="*" perm="775"/>
179 <!-- /if -->
180
181 </target>
182
183 <!-- start amp -->
184
185 <target name="Installing AMP">
186 <echo>Installing Apache, MySQL and PHP</echo>
187 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="amp.lzma"/></patternset></unzip>
188 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x amp.lzma"/></exec><!-- /if -->
189 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/amp.lzma" output="${basedir}/amp.comp"/><!-- /if -->
190 <delete file="amp.lzma"/>
191 <unzip src="${basedir}/amp.comp" dest="${installDir}/ext/amp"/>
192 <delete file="amp.comp"/>
193
194 <!-- if linux|mac -->
195 <echo>Setting binaries to executable</echo>
196 <chmod dir="${installDir}/ext/amp" includes="*" perm="775"/>
197 <!-- /if -->
198 </target>
199
200 <!-- end amp -->
201
202 <target name="Installing Tomcat">
203
204 <echo>Installing Tomcat (packages/tomcat)</echo>
205 <mkdir dir="packages"/>
206 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
207 <!-- if windows --><exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x tomcat.lzma"/></exec><!-- /if -->
208 <!-- if linux|mac --><sevenzip task="decode" input="${basedir}/tomcat.lzma" output="${basedir}/tomcat.comp"/><!-- /if -->
209 <delete file="tomcat.lzma"/>
210 <unzip src="${basedir}/tomcat.comp" dest="${installDir}"/>
211 <delete file="tomcat.comp"/>
212
213
214 <echo>Changing tomcat ports tomcat's server.xml</echo>
215 <copy file="${installDir}/resources/tomcat/server_tomcat6.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
216 <rsr file="${installDir}/packages/tomcat/conf/server.xml">
217 <job pattern="@port@" replacement="${tomcat.port}"/>
218 <job pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}"/>
219 </rsr>
220
221 <!-- FLAX START -->
222 <echo>Copying over FlaxWebService.wsdl and changing tomcat server/ports</echo>
223 <copy file="${installDir}/flax-resources/FlaxWebService.wsdl" tofile="${installDir}/web/FlaxWebService.wsdl" overwrite="true"/>
224 <rsr file="${installDir}/web/FlaxWebService.wsdl">
225 <job pattern="@flaxpublicserver@" replacement="${tomcat.server}"/>
226 <job pattern="@flaxpublicport@" replacement="${tomcat.port}"/>
227 </rsr>
228 <!-- FLAX END -->
229
230 <echo>Copying greenstone3.xml to tomcat directory</echo>
231 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
232 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}${file.separator}web" />
233 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@privilegedattribute@" replacement="privileged='true'" />
234 <echo>Set binaries to executable</echo>
235 <chmod dir="${installDir}/packages/tomcat/bin" includes="*.sh" perm="775"/>
236
237 </target>
238
239 <target name="Installing Start Menu Shortcuts">
240
241 <echo>Installing Start Menu Shortcuts</echo>
242
243 <mkdir dir="${startmenu.path}\Documentation"/>
244
245 <!-- NO FLAX START -->
246
247 <shortcut
248 file="${startmenu.path}\Greenstone3 Server.lnk"
249 execute="${installDir}\gs3-server.bat"
250 workingDirectory="${installDir}"
251 iconFile="${installDir}\resources\images\server.ico"
252 iconIndex="0" />
253
254 <shortcut
255 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
256 execute="${installDir}\gli\gli.bat"
257 workingDirectory="${installDir}\gli"
258 iconFile="${installDir}\resources\images\librarian.ico"
259 iconIndex="0" />
260
261 <shortcut
262 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
263 execute="${installDir}\gli\gems.bat"
264 workingDirectory="${installDir}\gli"
265 iconFile="${installDir}\resources\images\metadata.ico"
266 iconIndex="0" />
267
268 <shortcut
269 file="${startmenu.path}\Uninstall.lnk"
270 execute="${installDir}\uninstall\Uninstall.bat"
271 workingDirectory="${installDir}"
272 iconFile="${installDir}\resources\images\uninstall.ico"
273 iconIndex="0" />
274
275 <shortcut
276 file="${startmenu.path}\Documentation\README.lnk"
277 execute="${installDir}\README.txt" />
278
279 <shortcut
280 file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
281 execute="${installDir}\documentation\manual\manual.pdf" />
282
283 <shortcut
284 file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
285 execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
286
287 <shortcut
288 file="${startmenu.path}\Documentation\Greenstone Wiki.url"
289 url="http://wiki.greenstone.org" />
290
291 <shortcut
292 file="${startmenu.path}\Documentation\Greenstone Website.url"
293 url="http://www.greenstone.org" />
294
295 <!-- NO FLAX END -->
296
297 <!-- FLAX START-->
298
299 <shortcut
300 file="${startmenu.path}\Start FLAX Server.lnk"
301 execute="${installDir}\gs3-server.bat"
302 workingDirectory="${installDir}"
303 iconFile="${installDir}\resources\images\server.ico"
304 iconIndex="0" />
305
306 <shortcut
307 file="${startmenu.path}\Uninstall.lnk"
308 execute="${installDir}\uninstall\Uninstall.bat"
309 workingDirectory="${installDir}"
310 iconFile="${installDir}\resources\images\uninstall.ico"
311 iconIndex="0" />
312
313 <!-- FLAX END -->
314 </target>
315
316 <!-- util target to extract the given component -->
317 <!-- pass in ${component.name} as a param -->
318 <!-- unused at this time as causes display errors in installer gui!
319 <target name="extract-component">
320 <!- - extract the component into place - ->
321 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="${component.name}.lzma"/></patternset></unzip>
322 <!- - if windows - ->
323 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ${component.name}.lzma"/></exec>
324 <!- - /if - ->
325 <!- - if linux|mac - ->
326 <sevenzip task="decode" input="${basedir}/${component.name}.lzma" output="${basedir}/${component.name}.comp"/>
327 <!- - /if - ->
328 <delete file="${component.name}.lzma"/>
329 <unzip src="${basedir}/${component.name}.comp" dest="${installDir}"/>
330 <delete file="${component.name}.comp"/>
331 </target>
332 -->
333
334</project>
Note: See TracBrowser for help on using the repository browser.