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

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

create the english gli dictionary at install

File size: 8.7 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 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
60 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec>
61 <!--<sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>-->
62 <delete file="core.lzma"/>
63 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
64 <delete file="core.comp"/>
65
66 <!-- jre -->
67 <mkdir dir="${installDir}/packages"/>
68 <copy todir="${installDir}/packages/jre" failonerror="false">
69 <fileset dir="../@windows-java.extracted@"/>
70 </copy>
71
72 <echo message="Creating admin and demo users"/>
73 <adduser
74 txt2db="${installDir}/bin/windows/txt2db"
75 usersDb="${installDir}/etc/users.db"
76 username="admin"
77 password="${admin.password}"
78 groups="administrator,colbuilder"
79 comment="created at install time"/>
80 <adduser
81 txt2db="${installDir}/bin/windows/txt2db"
82 usersDb="${installDir}/etc/users.db"
83 username="demo"
84 password="demo"
85 groups="demo"
86 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
87
88 <echo>Correcting perl shebangs in perl scripts</echo>
89 <property name="perl.executable" value="${installDir.local}\bin\windows\perl\perl.exe"/>
90 <rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
91
92 <echo>Creating the english dictionary</echo>
93 <copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
94 <echo/>
95
96 <echo message="Creating installation properties file"/>
97 <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
98
99 <echo message="Finished"/>
100
101 </target>
102
103 <target name="Installing ImageMagick">
104 <echo message="Installing ImageMagick"/>
105 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
106 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec>
107 <!--<sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>-->
108 <delete file="imagemagick.lzma"/>
109 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/windows"/>
110 <delete file="imagemagick.comp"/>
111 </target>
112
113 <target name="Installing Ghostscript">
114 <echo message="Installing GhostScript"/>
115 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
116 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec>
117 <!--<sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>-->
118 <delete file="ghostscript.lzma"/>
119 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/windows"/>
120 <delete file="ghostscript.comp"/>
121 </target>
122
123 <!-- Start menu shortcuts -->
124 <target name="Installing Start Menu Shortcuts">
125
126 <mkdir dir="${startmenu.path}\Documentation"/>
127
128 <shortcut
129 file="${startmenu.path}\Greenstone Server.lnk"
130 execute="${installDir}\server.exe"
131 workingDirectory="${installDir}"
132 iconFile="${installDir}\images\serverico.ico"
133 iconIndex="0" />
134
135 <shortcut
136 file="${startmenu.path}\Librarian Interface (GLI).lnk"
137 execute="${installDir}\gli\gli.bat"
138 workingDirectory="${installDir}\gli"
139 iconFile="${installDir}\images\icon.ico"
140 iconIndex="0" />
141
142 <shortcut
143 file="${startmenu.path}\Metadata Set Editor (GEMS).lnk"
144 execute="${installDir}\gli\gems.bat"
145 workingDirectory="${installDir}\gli"
146 iconFile="${installDir}\images\gems.ico"
147 iconIndex="0" />
148
149 <shortcut
150 file="${startmenu.path}\Uninstall.lnk"
151 execute="${installDir}\Uninstall.bat"
152 workingDirectory="${installDir}"
153 iconFile="${installDir}\images\uninstall.ico"
154 iconIndex="0" />
155
156 <shortcut
157 file="${startmenu.path}\Documentation\READMEen.lnk"
158 execute="${installDir}\READMEen.txt" />
159
160 <shortcut
161 file="${startmenu.path}\Documentation\Greenstone Wiki.url"
162 url="http://wiki.greenstone.org" />
163
164 <shortcut
165 file="${startmenu.path}\Documentation\Greenstone Website.url"
166 url="http://www.greenstone.org" />
167
168<!--
169 <shortcut
170 file="${startmenu.path}\Documentation\READMEes.lnk"
171 execute="${installDir}\READMEes.txt" />
172
173 <shortcut
174 file="${startmenu.path}\Documentation\READMEar.lnk"
175 execute="${installDir}\READMEar.txt" />
176
177 <shortcut
178 file="${startmenu.path}\Documentation\READMEfr.lnk"
179 execute="${installDir}\READMEfr.txt" />
180
181 <shortcut
182 file="${startmenu.path}\Documentation\READMEru.lnk"
183 execute="${installDir}\READMEru.txt" />
184 -->
185
186 </target>
187
188 <target name="Source Release" depends="">
189
190 <!-- create the installation directory -->
191 <echo message="Creating Installation directory"/>
192 <mkdir dir="${installDir}"/>
193
194 <!-- extract 7za tool -->
195 <unzip src="${antinstaller.jar}" dest="${basedir}">
196 <patternset><include name="7za.exe"/></patternset>
197 </unzip>
198
199 <echo>Installing Source Release</echo>
200 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
201 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x source-release.lzma"/></exec>
202 <delete file="source-release.lzma"/>
203 <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
204 <delete file="source-release.comp"/>
205
206 <!-- figure out the start menu path -->
207 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
208 <path id="startmenu.path.path" path="${startmenu.path}"/>
209 <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
210
211 <echo message="Filling in concrete values in config files"/>
212 <rsr file="${installDir}/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
213 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
214 <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
215 <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
216 <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
217 </rsr>
218
219 <echo>Create usage.txt</echo>
220 <echo file="${installDir}/etc/usage.txt"></echo>
221
222 <echo message="Creating installation properties file"/>
223 <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
224
225 <echo message="Finished"/>
226
227 </target>
228
229
230</project>
Note: See TracBrowser for help on using the repository browser.