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

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

new logic for installing components as they are now individually compressed

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