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

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

started source releases

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