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

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

changes that went in for the 2.82cd release

File size: 9.8 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}/packages"/>
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 <copy todir="${installDir}/packages/jre" failonerror="false">
67 <fileset dir="../@windows-java.extracted@"/>
68 </copy>
69 <!-- end web -->
70
71 <!-- start cdrom -->
72 <copy todir="${installDir}">
73 <fileset dir="${orig.dir}/Software/core/all"/>
74 <fileset dir="${orig.dir}/Software/core/windows"/>
75 </copy>
76 <copy todir="${installDir}/packages/jre" failonerror="false">
77 <fileset dir="${orig.dir}/Java/Windows/jre"/>
78 </copy>
79 <!-- end cdrom -->
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 <copy file="${installDir}/cgi-bin/gsdlsite.cfg.in" tofile="${installDir}/cgi-bin/gsdlsite.cfg"/>
230 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
231 <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
232 <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
233 <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
234 </rsr>
235
236 <echo>Create usage.txt</echo>
237 <echo file="${installDir}/etc/usage.txt"></echo>
238
239 <echo message="Creating installation properties file"/>
240 <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
241
242 <echo message="Finished"/>
243
244 </target>
245
246 <target name="Configuring Administration Pages" if="enable.admin.pages">
247 <echo>Enabling Admin Pages</echo>
248 <rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
249 <echo message="Creating admin and demo users"/>
250 <adduser
251 txt2db="${installDir}/bin/windows/txt2db"
252 usersDb="${installDir}/etc/users.gdb"
253 username="admin"
254 password="${admin.password}"
255 groups="administrator,colbuilder,all-collections-editor"
256 comment="created at install time"/>
257 <adduser
258 txt2db="${installDir}/bin/windows/txt2db"
259 usersDb="${installDir}/etc/users.gdb"
260 username="demo"
261 password="demo"
262 groups="demo"
263 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
264 </target>
265
266 <target name="Installing Documented Examples">
267 <copy todir="${installDir}/collect">
268 <fileset dir="${orig.dir}/Documented Examples" includes="documented-examples/**/*"/>
269 </copy>
270 </target>
271
272
273</project>
Note: See TracBrowser for help on using the repository browser.