source: release-kits/wirk3/installer/build.xml@ 17416

Last change on this file since 17416 was 17416, checked in by oranfry, 16 years ago

a few fixups after component changes

File size: 9.3 KB
Line 
1<?xml version="1.0"?>
2<!--
3This is the build.xml run by AntInstaller for the installer
4-->
5
6<project name="Installation" default="" basedir="${basedir}">
7
8 <!-- this is required to pick up the properties generated during the install pages -->
9 <property file="${basedir}/ant.install.properties"/>
10
11 <path id="project.classpath">
12 <pathelement path="${antinstaller.jar}"/>
13 </path>
14
15 <!-- custom tasks -->
16 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
17 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
18 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
19 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
20
21 <!-- create a local installDir String -->
22 <path id="installDir.path">
23 <pathelement location="${installDir}"/>
24 </path>
25 <property name="installDir.local" refid="installDir.path"/>
26 <pathconvert targetos="unix" property="installDir.unix" refid="installDir.path"/>
27
28
29 <!-- load windows properties -->
30 <winprops/>
31
32 <!-- determine if there is an existing installation in the installDir-->
33 <available file="${installDir}\installation.properties" property="is.overinstall"/>
34
35 <target name="load-previous-props" if="is.overinstall">
36 <property file="${installDir}\installation.properties"/>
37 </target>
38
39 <target name="install-core-components" depends="load-previous-props">
40
41 <!-- figure out the start menu path (if not already set from previous installation) -->
42 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
43
44 <echo>basedir: ${basedir}</echo>
45 <echo>installDir: ${installDir}</echo>
46 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
47 <echo>startmenu.path: ${startmenu.path}</echo>
48
49 <!-- create the installation directory -->
50 <echo message="Creating Installation directory"/>
51 <mkdir dir="${installDir}"/>
52
53 <!-- extract 7za tool -->
54 <unzip src="${antinstaller.jar}" dest="${basedir}">
55 <patternset><include name="7za.exe"/></patternset>
56 </unzip>
57
58 <!-- install files -->
59 <echo message="Installing Core Component"/>
60 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
61 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec>
62 <delete file="core.lzma"/>
63 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
64 <delete file="core.comp"/>
65
66 <!-- rename greenstone3-build.xml back to build.xml -->
67 <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
68
69 <!-- change the tomcat ports in build.properties -->
70 <echo message="Changing tomcat ports in build.properties"/>
71 <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
72 <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
73 <echo message="Changing tomcat ports in resources/tomcat/server.xml"/>
74 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir.local}/packages/tomcat/conf/server.xml" overwrite="true"/>
75
76 <!-- set gsdlhome in gs2build setup.bat -->
77 <echo message="Setting %GSDLHOME% in gs2build\setup.bat"/>
78 <rsr file="${installDir}/gs2build/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir.local}\gs2build" />
79 <!-- copy the greenstone3.xml file to tomcat -->
80 <echo message="Copying greenstone3.xml to tomcat directory"/>
81 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
82 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" />
83
84 <!-- set up global properties -->
85 <echo message="Setting up global properties"/>
86 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
87 <rsr file="${installDir}/web/WEB-INF/classes/global.properties">
88 <job pattern="@gsdl3home@" replacement="${installDir.unix}/web" />
89 <job pattern="@tomcat.server@" replacement="${tomcat.server}" />
90 <job pattern="@tomcat.port@" replacement="${tomcat.port}" />
91 </rsr>
92
93 <!-- set up log4j properties-->
94 <echo message="Setting up log4j properties"/>
95 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
96 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.unix}/web"/>
97
98 <!-- delete unneeded files -->
99 <delete dir="${installDir}/resources/icons"/>
100 <delete file="${installDir}/resources/*.png"/>
101
102 <echo message="Creating installation properties file"/>
103 <echo file="${installDir}\installation.properties">startmenu.path:${startmenu.path}</echo>
104
105 </target>
106
107 <!-- Source -->
108 <target name="install-source-code">
109 <echo message="Installing Source Code (src)"/>
110 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
111 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x sourcecode.lzma"/></exec>
112 <delete file="sourcecode.lzma"/>
113 <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
114 <delete file="sourcecode.comp"/>
115 </target>
116
117 <target name="install-tomcat">
118
119 <echo message="Installing Apache Tomcat"/>
120 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
121 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x tomcat.lzma"/></exec>
122 <delete file="tomcat.lzma"/>
123 <unzip src="${basedir}/tomcat.comp" dest="${installDir}/packages"/>
124 <delete file="tomcat.comp"/>
125
126 <!-- change the tomcat ports in tomcats server.xml -->
127 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@server@" replacement="${tomcat.server}" />
128 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@port@" replacement="${tomcat.port}" />
129 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" />
130
131 </target>
132
133 <target name="install-ant">
134 <echo message="Installing Apache Ant"/>
135 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ant.lzma"/></patternset></unzip>
136 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ant.lzma"/></exec>
137 <delete file="ant.lzma"/>
138 <unzip src="${basedir}/ant.comp" dest="${installDir}/packages"/>
139 <delete file="ant.comp"/>
140 </target>
141
142 <target name="install-imagemagick">
143 <echo message="Installing ImageMagick"/>
144 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
145 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec>
146 <delete file="imagemagick.lzma"/>
147 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/gs2build/bin/windows"/>
148 <delete file="imagemagick.comp"/>
149 </target>
150
151 <target name="install-ghostscript">
152 <echo message="Installing GhostScript"/>
153 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
154 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec>
155 <delete file="ghostscript.lzma"/>
156 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/gs2build/bin/windows"/>
157 <delete file="ghostscript.comp"/>
158 </target>
159
160 <target name="install-windows-jre">
161 <echo>Installing Java Runtime Environment</echo>
162 <mkdir dir="${installDir}/packages"/>
163 <copy todir="${installDir}/packages/jre">
164 <fileset dir="../@windows-java.extracted@"/>
165 </copy>
166 </target>
167
168 <target name="cleanuptarget">
169 </target>
170
171 <target name="install-start-menu-shortcuts">
172
173 <mkdir dir="${startmenu.path}\Documentation"/>
174
175 <shortcut
176 file="${startmenu.path}\Greenstone3 Server.lnk"
177 execute="${installDir}\gs3-server.bat"
178 workingDirectory="${installDir}"
179 iconFile="${installDir}\resources\images\gs3.ico"
180 iconIndex="0" />
181
182 <shortcut
183 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
184 execute="${installDir}\gli\gli.bat"
185 workingDirectory="${installDir}\gli"
186 iconFile="${installDir}\resources\images\gs3.ico"
187 iconIndex="0" />
188
189 <shortcut
190 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
191 execute="${installDir}\gli\gems.bat"
192 workingDirectory="${installDir}\gli"
193 iconFile="${installDir}\resources\images\gs3.ico"
194 iconIndex="0" />
195
196 <shortcut
197 file="${startmenu.path}\Uninstall.lnk"
198 execute="${installDir}\winutil\search4j.exe -h packages\jre -l Uninstall.jar"
199 workingDirectory="${installDir}"
200 iconFile="${installDir}\images\gs3.ico"
201 iconIndex="0" />
202
203 <shortcut
204 file="${startmenu.path}\Documentation\README.lnk"
205 execute="${installDir}\README.txt" />
206
207 <shortcut
208 file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
209 execute="${installDir}\documentation\manual\manual.pdf" />
210
211 <shortcut
212 file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
213 execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
214
215 </target>
216
217</project>
Note: See TracBrowser for help on using the repository browser.