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

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

gsdlsite.cfg renamed - updating release kit appropriately, also added missing -r tags in httpd copy

File size: 8.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 <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 message="Installing Servers"/>
89 <copy todir="${installDir}" file="${installDir}/bin/windows/server.exe"/>
90 <copy tofile="${installDir}/cgi-bin/oaiserver" file="${installDir}/bin/windows/oaiserver.exe"/>
91 <copy tofile="${installDir}/cgi-bin/library" file="${installDir}/bin/windows/library.exe"/>
92
93 <echo message="Creating installation properties file"/>
94 <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
95
96 <echo message="Finished"/>
97
98 </target>
99
100 <target name="Installing ImageMagick">
101 <echo message="Installing ImageMagick"/>
102 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
103 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec>
104 <!--<sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>-->
105 <delete file="imagemagick.lzma"/>
106 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/windows"/>
107 <delete file="imagemagick.comp"/>
108 </target>
109
110 <target name="Installing Ghostscript">
111 <echo message="Installing GhostScript"/>
112 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
113 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec>
114 <!--<sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>-->
115 <delete file="ghostscript.lzma"/>
116 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/windows"/>
117 <delete file="ghostscript.comp"/>
118 </target>
119
120 <!-- Start menu shortcuts -->
121 <target name="Installing Start Menu Shortcuts">
122
123 <mkdir dir="${startmenu.path}\Documentation"/>
124
125 <shortcut
126 file="${startmenu.path}\Greenstone Server.lnk"
127 execute="${installDir}\server.exe"
128 workingDirectory="${installDir}"
129 iconFile="${installDir}\images\serverico.ico"
130 iconIndex="0" />
131
132 <shortcut
133 file="${startmenu.path}\Librarian Interface (GLI).lnk"
134 execute="${installDir}\gli\gli.bat"
135 workingDirectory="${installDir}\gli"
136 iconFile="${installDir}\images\icon.ico"
137 iconIndex="0" />
138
139 <shortcut
140 file="${startmenu.path}\Metadata Set Editor (GEMS).lnk"
141 execute="${installDir}\gli\gems.bat"
142 workingDirectory="${installDir}\gli"
143 iconFile="${installDir}\images\gems.ico"
144 iconIndex="0" />
145
146 <shortcut
147 file="${startmenu.path}\Uninstall.lnk"
148 execute="${installDir}\Uninstall.bat"
149 workingDirectory="${installDir}"
150 iconFile="${installDir}\images\uninstall.ico"
151 iconIndex="0" />
152
153 <shortcut
154 file="${startmenu.path}\Documentation\READMEen.lnk"
155 execute="${installDir}\READMEen.txt" />
156
157 <shortcut
158 file="${startmenu.path}\Documentation\Greenstone Wiki.url"
159 url="http://wiki.greenstone.org" />
160
161 <shortcut
162 file="${startmenu.path}\Documentation\Greenstone Website.url"
163 url="http://www.greenstone.org" />
164
165<!--
166 <shortcut
167 file="${startmenu.path}\Documentation\READMEes.lnk"
168 execute="${installDir}\READMEes.txt" />
169
170 <shortcut
171 file="${startmenu.path}\Documentation\READMEar.lnk"
172 execute="${installDir}\READMEar.txt" />
173
174 <shortcut
175 file="${startmenu.path}\Documentation\READMEfr.lnk"
176 execute="${installDir}\READMEfr.txt" />
177
178 <shortcut
179 file="${startmenu.path}\Documentation\READMEru.lnk"
180 execute="${installDir}\READMEru.txt" />
181 -->
182
183 </target>
184
185 <target name="Source Release" depends="">
186
187 <!-- create the installation directory -->
188 <echo message="Creating Installation directory"/>
189 <mkdir dir="${installDir}"/>
190
191 <!-- extract 7za tool -->
192 <unzip src="${antinstaller.jar}" dest="${basedir}">
193 <patternset><include name="7za.exe"/></patternset>
194 </unzip>
195
196 <echo>Installing Source Release</echo>
197 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
198 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x source-release.lzma"/></exec>
199 <delete file="source-release.lzma"/>
200 <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
201 <delete file="source-release.comp"/>
202
203 <!-- figure out the start menu path -->
204 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
205 <path id="startmenu.path.path" path="${startmenu.path}"/>
206 <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
207
208 <echo message="Filling in concrete values in config files"/>
209 <rsr file="${installDir}/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
210 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
211 <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
212 <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
213 <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
214 </rsr>
215
216 <echo>Create usage.txt</echo>
217 <echo file="${installDir}/etc/usage.txt"></echo>
218
219 <echo message="Creating installation properties file"/>
220 <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
221
222 <echo message="Finished"/>
223
224 </target>
225
226
227</project>
Note: See TracBrowser for help on using the repository browser.