source: release-kits/wirk2/installer/build.xml@ 19510

Last change on this file since 19510 was 19510, checked in by oranfry, 15 years ago

main release kits now create their own cdrom installers and wrap them

File size: 9.5 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">
7
8 <!-- classpath -->
9 <path id="project.classpath"><pathelement path="${antinstaller.jar}"/></path>
10
11 <!-- custom tasks -->
12 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
13 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
14 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
15 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
16 <typedef name="adduser" classname="org.greenstone.anttasks.AddGreenstoneUserToDatabase" classpathref="project.classpath"/>
17
18 <!-- pick up the properties generated during the install pages -->
19 <property file="${basedir}/ant.install.properties"/>
20
21 <!-- determine if there is an existing installation in the installDir-->
22 <available file="${installDir}\etc\installation.properties" property="is.overinstall"/>
23
24 <!-- load windows properties -->
25 <winprops/>
26
27 <!-- create a local installDir String -->
28 <path id="installDir.path"><pathelement location="${installDir}"/></path>
29 <property name="installDir.local" refid="installDir.path"/>
30
31 <target name="Looking For Previous Installation" if="is.overinstall">
32 <property file="${installDir}\etc\installation.properties"/>
33 <delete dir="${installed.startmenu.path}" failonerror="false"/>
34 </target>
35
36 <target name="Installing Core System">
37
38 <!-- figure out the start menu path -->
39 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
40 <path id="startmenu.path.path" path="${startmenu.path}"/>
41 <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
42
43 <echo>basedir: ${basedir}</echo>
44 <echo>installDir: ${installDir}</echo>
45 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
46 <echo>startmenu.path: ${startmenu.path}</echo>
47
48 <!-- create the installation directory -->
49 <echo message="Creating Installation directory"/>
50 <mkdir dir="${installDir}"/>
51
52 <!-- extract 7za tool -->
53 <unzip src="${antinstaller.jar}" dest="${basedir}">
54 <patternset><include name="7za.exe"/></patternset>
55 </unzip>
56
57 <!-- install files -->
58 <echo message="Installing Core Component"/>
59
60 <!-- start web -->
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 <!-- end web -->
67
68 <!-- start cdrom -->
69 <copy todir="${installDir}">
70 <fileset dir="${orig.dir}/Software/core/all"/>
71 <fileset dir="${orig.dir}/Software/core/windows"/>
72 </copy>
73 <!-- end cdrom -->
74
75 <!-- jre -->
76 <mkdir dir="${installDir}/packages"/>
77 <copy todir="${installDir}/packages/jre" failonerror="false">
78 <fileset dir="../@windows-java.extracted@"/>
79 </copy>
80
81 <echo>Correcting perl shebangs in perl scripts</echo>
82 <property name="perl.executable" value="${installDir.local}\bin\windows\perl\perl.exe"/>
83 <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
84
85 <echo>Creating the english dictionary</echo>
86 <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
87 <echo/>
88
89 <echo message="Creating installation properties file"/>
90 <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
91
92 <echo message="Finished"/>
93
94 </target>
95
96 <target name="Installing ImageMagick">
97 <echo message="Installing ImageMagick"/>
98 <!-- start web -->
99 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
100 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec>
101 <delete file="imagemagick.lzma"/>
102 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/windows"/>
103 <delete file="imagemagick.comp"/>
104 <!-- end web -->
105
106 <!-- start cdrom -->
107 <copy todir="${installDir}/bin/windows">
108 <fileset dir="${orig.dir}/Software/imagemagick/windows"/>
109 </copy>
110 <!-- end cdrom -->
111
112 </target>
113
114 <target name="Installing Ghostscript">
115 <echo message="Installing GhostScript"/>
116 <!-- start web -->
117 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
118 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec>
119 <delete file="ghostscript.lzma"/>
120 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/windows"/>
121 <delete file="ghostscript.comp"/>
122 <!-- end web -->
123
124 <!-- start cdrom -->
125 <copy todir="${installDir}/bin/windows">
126 <fileset dir="${orig.dir}/Software/ghostscript/windows"/>
127 </copy>
128 <!-- end cdrom -->
129
130 </target>
131
132 <!-- Start menu shortcuts -->
133 <target name="Installing Start Menu Shortcuts">
134
135 <mkdir dir="${startmenu.path}\Documentation"/>
136
137 <shortcut
138 file="${startmenu.path}\Greenstone Server.lnk"
139 execute="${installDir}\server.exe"
140 workingDirectory="${installDir}"
141 iconFile="${installDir}\web\images\serverico.ico"
142 iconIndex="0" />
143
144 <shortcut
145 file="${startmenu.path}\Librarian Interface (GLI).lnk"
146 execute="${installDir}\gli\gli.bat"
147 workingDirectory="${installDir}\gli"
148 iconFile="${installDir}\web\images\icon.ico"
149 iconIndex="0" />
150
151 <shortcut
152 file="${startmenu.path}\Librarian Interface for Remote Server (Client GLI).lnk"
153 execute="${installDir}\gli\client-gli.bat"
154 workingDirectory="${installDir}\gli"
155 iconFile="${installDir}\web\images\icon.ico"
156 iconIndex="0" />
157
158 <shortcut
159 file="${startmenu.path}\Metadata Set Editor (GEMS).lnk"
160 execute="${installDir}\gli\gems.bat"
161 workingDirectory="${installDir}\gli"
162 iconFile="${installDir}\web\images\gems.ico"
163 iconIndex="0" />
164
165 <shortcut
166 file="${startmenu.path}\Uninstall.lnk"
167 execute="${installDir}\Uninstall.bat"
168 workingDirectory="${installDir}"
169 iconFile="${installDir}\web\images\uninstall.ico"
170 iconIndex="0" />
171
172 <shortcut
173 file="${startmenu.path}\Documentation\READMEen.lnk"
174 execute="${installDir}\READMEen.txt" />
175
176 <shortcut
177 file="${startmenu.path}\Documentation\Greenstone Wiki.url"
178 url="http://wiki.greenstone.org" />
179
180 <shortcut
181 file="${startmenu.path}\Documentation\Greenstone Website.url"
182 url="http://www.greenstone.org" />
183
184<!--
185 <shortcut
186 file="${startmenu.path}\Documentation\READMEes.lnk"
187 execute="${installDir}\READMEes.txt" />
188
189 <shortcut
190 file="${startmenu.path}\Documentation\READMEar.lnk"
191 execute="${installDir}\READMEar.txt" />
192
193 <shortcut
194 file="${startmenu.path}\Documentation\READMEfr.lnk"
195 execute="${installDir}\READMEfr.txt" />
196
197 <shortcut
198 file="${startmenu.path}\Documentation\READMEru.lnk"
199 execute="${installDir}\READMEru.txt" />
200 -->
201
202 </target>
203
204 <target name="Source Release" depends="">
205
206 <!-- create the installation directory -->
207 <echo message="Creating Installation directory"/>
208 <mkdir dir="${installDir}"/>
209
210 <!-- extract 7za tool -->
211 <unzip src="${antinstaller.jar}" dest="${basedir}">
212 <patternset><include name="7za.exe"/></patternset>
213 </unzip>
214
215 <echo>Installing Source Release</echo>
216 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
217 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x source-release.lzma"/></exec>
218 <delete file="source-release.lzma"/>
219 <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
220 <delete file="source-release.comp"/>
221
222 <!-- figure out the start menu path -->
223 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
224 <path id="startmenu.path.path" path="${startmenu.path}"/>
225 <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
226
227 <echo message="Filling in concrete values in config files"/>
228 <rsr file="${installDir}/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
229 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
230 <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
231 <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
232 <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
233 </rsr>
234
235 <echo>Create usage.txt</echo>
236 <echo file="${installDir}/etc/usage.txt"></echo>
237
238 <echo message="Creating installation properties file"/>
239 <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
240
241 <echo message="Finished"/>
242
243 </target>
244
245 <target name="Configuring Administration Pages" if="enable.admin.pages">
246 <echo>Enabling Admin Pages</echo>
247 <rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
248 <echo message="Creating admin and demo users"/>
249 <adduser
250 txt2db="${installDir}/bin/windows/txt2db"
251 usersDb="${installDir}/etc/users.gdb"
252 username="admin"
253 password="${admin.password}"
254 groups="administrator,colbuilder,all-collections-editor"
255 comment="created at install time"/>
256 <adduser
257 txt2db="${installDir}/bin/windows/txt2db"
258 usersDb="${installDir}/etc/users.gdb"
259 username="demo"
260 password="demo"
261 groups="demo"
262 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
263 </target>
264
265
266
267</project>
Note: See TracBrowser for help on using the repository browser.