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

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

changes to the way binaries are stored in the cgi-bin and bin/(os) directories

File size: 7.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 <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
18
19 <!-- pick up the properties generated during the install pages -->
20 <property file="${basedir}/ant.install.properties"/>
21
22 <!-- determine if there is an existing installation in the installDir-->
23 <available file="${installDir}\etc\installation.properties" property="is.overinstall"/>
24
25 <!-- load windows properties -->
26 <winprops/>
27
28 <!-- create a local installDir String -->
29 <path id="installDir.path"><pathelement location="${installDir}"/></path>
30 <property name="installDir.local" refid="installDir.path"/>
31
32 <target name="load-previous-props" if="is.overinstall">
33 <property file="${installDir}\etc\installation.properties"/>
34 </target>
35
36 <target name="install-core-components" depends="load-previous-props">
37
38 <!-- figure out the start menu path (if not already set from previous installation) -->
39 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
40
41 <echo>basedir: ${basedir}</echo>
42 <echo>installDir: ${installDir}</echo>
43 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
44 <echo>startmenu.path: ${startmenu.path}</echo>
45
46 <!-- create the installation directory -->
47 <echo message="Creating Installation directory"/>
48 <mkdir dir="${installDir}"/>
49
50 <!-- extract 7za tool -->
51 <unzip src="${antinstaller.jar}" dest="${basedir}">
52 <patternset><include name="7za.exe"/></patternset>
53 </unzip>
54
55 <!-- install files -->
56 <echo message="Installing Core Component"/>
57 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
58 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec>
59 <!--<sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>-->
60 <delete file="core.lzma"/>
61 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
62 <delete file="core.comp"/>
63
64 <echo message="Creating admin and demo users"/>
65 <adduser
66 txt2db="${installDir}/bin/windows/txt2db"
67 usersDb="${installDir}/etc/users.db"
68 username="admin"
69 password="${admin.password}"
70 groups="administrator,colbuilder"
71 comment="created at install time"/>
72 <adduser
73 txt2db="${installDir}/bin/windows/txt2db"
74 usersDb="${installDir}/etc/users.db"
75 username="demo"
76 password="demo"
77 groups="demo"
78 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
79
80 <echo message="Installing Servers"/>
81 <copy todir="${installDir}" file="${installDir}/bin/windows/server.exe"/>
82 <copy tofile="${installDir}/cgi-bin/oaiserver" file="${installDir}/bin/windows/oaiserver.exe"/>
83 <copy tofile="${installDir}/cgi-bin/library" file="${installDir}/bin/windows/library.exe"/>
84
85 <echo message="Filling in concrete values in config files"/>
86 <rsr file="${installDir}/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
87 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
88 <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
89 <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
90 <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
91 </rsr>
92 <rsr file="${installDir}/gsdlsite.cfg" pattern="@gsdlhome@" replacement="${installDir}"/>
93
94 <echo message="Creating installation properties file"/>
95 <echo file="${installDir}\etc\installation.properties">startmenu.path:${startmenu.path}</echo>
96
97 <echo message="Finished"/>
98
99 </target>
100
101 <!-- Source -->
102 <target name="install-source-code" depends="">
103 <echo message="Installing Source Code"/>
104 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
105 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x sourcecode.lzma"/></exec>
106 <!--<sevenzip task="decode" input="${basedir}/sourcecode.lzma" output="${basedir}/sourcecode.comp"/>-->
107 <delete file="sourcecode.lzma"/>
108 <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
109 <delete file="sourcecode.comp"/>
110 </target>
111
112 <target name="install-windows-jre">
113 <echo>Installing Java Runtime Environment</echo>
114 <mkdir dir="${installDir}/packages"/>
115 <copy todir="${installDir}/packages/jre">
116 <fileset dir="../@windows-java.extracted@"/>
117 </copy>
118 </target>
119
120 <target name="install-imagemagick">
121 <echo message="Installing ImageMagick"/>
122 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
123 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec>
124 <!--<sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>-->
125 <delete file="imagemagick.lzma"/>
126 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/windows"/>
127 <delete file="imagemagick.comp"/>
128 </target>
129
130 <target name="install-ghostscript">
131 <echo message="Installing GhostScript"/>
132 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
133 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec>
134 <!--<sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>-->
135 <delete file="ghostscript.lzma"/>
136 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/windows"/>
137 <delete file="ghostscript.comp"/>
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\gems.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}\Uninstall.bat"
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.