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

Last change on this file since 17311 was 17311, checked in by oranfry, 16 years ago

standardised the java bundling stuff

File size: 6.4 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="load-previous-props" if="is.overinstall">
32 <property file="${installDir}\etc\installation.properties"/>
33 </target>
34
35 <target name="install-core-components" depends="load-previous-props">
36
37 <!-- figure out the start menu path (if not already set from previous installation) -->
38 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
39
40 <echo>basedir: ${basedir}</echo>
41 <echo>installDir: ${installDir}</echo>
42 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
43 <echo>startmenu.path: ${startmenu.path}</echo>
44
45 <!-- create the installation directory -->
46 <echo message="Creating Installation directory"/>
47 <mkdir dir="${installDir}"/>
48
49 <!-- install files -->
50 <echo message="Installing Files"/>
51 <unzip src="${antinstaller.jar}" dest="${installDir}">
52 <patternset>
53
54 <include name="gli/**/*"/>
55 <include name="bin/**/*"/>
56 <include name="cgi-bin/**/*"/>
57 <include name="etc/**/*"/>
58 <include name="mappings/**/*"/>
59 <include name="images/**/*"/>
60 <include name="perllib/**/*"/>
61 <include name="indexers/**/*"/>
62 <include name="macros/**/*"/>
63 <include name="collect/**/*"/>
64
65 <include name="LICENSE.txt"/>
66 <include name="READMEar.txt"/>
67 <include name="READMEes.txt"/>
68 <include name="READMEen.txt"/>
69 <include name="READMEfr.txt"/>
70 <include name="READMEru.txt"/>
71 <include name="setup.bat"/>
72 <include name="server.exe"/>
73 <include name="Uninstall.jar"/>
74 <include name="gsdlsite.cfg"/>
75
76 </patternset>
77 </unzip>
78 <echo/>
79
80 <echo message="Creating admin and demo users"/>
81 <adduser
82 txt2db="${installDir}/bin/windows/txt2db"
83 usersDb="${installDir}/etc/users.db"
84 username="admin"
85 password="${admin.password}"
86 groups="administrator,colbuilder"
87 comment="created at install time"/>
88 <adduser
89 txt2db="${installDir}/bin/windows/txt2db"
90 usersDb="${installDir}/etc/users.db"
91 username="demo"
92 password="demo"
93 groups="demo"
94 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
95
96 <!-- delete unneeded files -->
97 <echo message="Deleting some unneeded files"/>
98 <delete dir="${installDir}/resources/icons"/>
99 <delete file="${installDir}/resources/*.png"/>
100
101 <echo message="Filling in concrete values in config files"/>
102 <rsr file="${installDir}/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
103 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
104 <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
105 <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
106 <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
107 </rsr>
108 <rsr file="${installDir}/gsdlsite.cfg" pattern="@gsdlhome@" replacement="${installDir}"/>
109
110 <echo message="Creating installation properties file"/>
111 <echo file="${installDir}\etc\installation.properties">startmenu.path:${startmenu.path}</echo>
112
113 <echo message="Finished"/>
114
115 </target>
116
117 <!-- Source -->
118 <target name="install-source-code" depends="">
119
120 <echo message="Installing Source Code"/>
121 <unzip src="${antinstaller.jar}" dest="${installDir}">
122 <patternset>
123 <include name="common-src/**/*"/>
124 <include name="runtime-src/**/*"/>
125 <include name="build-src/**/*"/>
126 <include name="packages/**/*"/>
127 </patternset>
128 </unzip>
129
130 </target>
131
132 <target name="install-java">
133 <echo>Installing bundled java</echo>
134 <mkdir dir="${installDir}/packages"/>
135 <copy todir="${installDir}/packages/jre">
136 <fileset dir="../@java.extracted@"/>
137 </copy>
138 </target>
139
140 <!-- Start menu shortcuts -->
141 <target name="install-start-menu-shortcuts">
142
143 <mkdir dir="${startmenu.path}\Documentation"/>
144
145 <shortcut
146 file="${startmenu.path}\Greenstone2 Server.lnk"
147 execute="${installDir}\server.exe"
148 workingDirectory="${installDir}"
149 iconFile="${installDir}\images\icon.ico"
150 iconIndex="0" />
151 <shortcut
152 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
153 execute="${installDir}\gli\gli.bat"
154 workingDirectory="${installDir}\gli"
155 iconFile="${installDir}\images\icon.ico"
156 iconIndex="0" />
157 <shortcut
158 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
159 execute="${installDir}\gli\gems4gs3.bat"
160 workingDirectory="${installDir}\gli"
161 iconFile="${installDir}\images\icon.ico"
162 iconIndex="0" />
163 <shortcut
164 file="${startmenu.path}\Uninstall.lnk"
165 execute="${installDir}\bin\windows\search4j.exe -h packages\jre -l Uninstall.jar"
166 workingDirectory="${installDir}"
167 iconFile="${installDir}\images\icon.ico"
168 iconIndex="0" />
169 <shortcut
170 file="${startmenu.path}\Documentation\READMEen.lnk"
171 execute="${installDir}\READMEen.txt" />
172 <shortcut
173 file="${startmenu.path}\Documentation\READMEes.lnk"
174 execute="${installDir}\READMEes.txt" />
175 <shortcut
176 file="${startmenu.path}\Documentation\READMEar.lnk"
177 execute="${installDir}\READMEar.txt" />
178 <shortcut
179 file="${startmenu.path}\Documentation\READMEfr.lnk"
180 execute="${installDir}\READMEfr.txt" />
181 <shortcut
182 file="${startmenu.path}\Documentation\READMEru.lnk"
183 execute="${installDir}\READMEru.txt" />
184 </target>
185
186 <target name="cleanuptarget"></target>
187
188
189</project>
Note: See TracBrowser for help on using the repository browser.