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

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

new logic for installing components which are now individually compressed

File size: 7.1 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 <!-- extract 7za tool -->
50 <unzip src="${antinstaller.jar}" dest="${basedir}">
51 <patternset><include name="7za.exe"/></patternset>
52 </unzip>
53
54 <!-- install files -->
55 <echo message="Installing Core Component"/>
56 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
57 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec>
58 <delete file="core.lzma"/>
59 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
60 <delete file="core.comp"/>
61
62 <echo message="Creating admin and demo users"/>
63 <adduser
64 txt2db="${installDir}/bin/windows/txt2db"
65 usersDb="${installDir}/etc/users.db"
66 username="admin"
67 password="${admin.password}"
68 groups="administrator,colbuilder"
69 comment="created at install time"/>
70 <adduser
71 txt2db="${installDir}/bin/windows/txt2db"
72 usersDb="${installDir}/etc/users.db"
73 username="demo"
74 password="demo"
75 groups="demo"
76 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
77
78 <!-- delete unneeded files -->
79 <echo message="Deleting some unneeded files"/>
80 <delete dir="${installDir}/resources/icons"/>
81 <delete file="${installDir}/resources/*.png"/>
82
83 <echo message="Filling in concrete values in config files"/>
84 <rsr file="${installDir}/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
85 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
86 <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
87 <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
88 <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
89 </rsr>
90 <rsr file="${installDir}/gsdlsite.cfg" pattern="@gsdlhome@" replacement="${installDir}"/>
91
92 <echo message="Creating installation properties file"/>
93 <echo file="${installDir}\etc\installation.properties">startmenu.path:${startmenu.path}</echo>
94
95 <echo message="Finished"/>
96
97 </target>
98
99 <!-- Source -->
100 <target name="install-source-code" depends="">
101 <echo message="Installing Source Code"/>
102 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
103 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x sourcecode.lzma"/></exec>
104 <delete file="sourcecode.lzma"/>
105 <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
106 <delete file="sourcecode.comp"/>
107 </target>
108
109 <target name="install-windows-jre">
110 <echo>Installing Java Runtime Environment</echo>
111 <mkdir dir="${installDir}/packages"/>
112 <copy todir="${installDir}/packages/jre">
113 <fileset dir="../@windows-java.extracted@"/>
114 </copy>
115 </target>
116
117 <target name="install-imagemagick">
118 <echo message="Installing ImageMagick"/>
119 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
120 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec>
121 <delete file="imagemagick.lzma"/>
122 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/windows"/>
123 <delete file="imagemagick.comp"/>
124 </target>
125
126 <target name="install-ghostscript">
127 <echo message="Installing GhostScript"/>
128 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
129 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec>
130 <delete file="ghostscript.lzma"/>
131 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/windows"/>
132 <delete file="ghostscript.comp"/>
133 </target>
134
135 <!-- Start menu shortcuts -->
136 <target name="install-start-menu-shortcuts">
137
138 <mkdir dir="${startmenu.path}\Documentation"/>
139
140 <shortcut
141 file="${startmenu.path}\Greenstone2 Server.lnk"
142 execute="${installDir}\server.exe"
143 workingDirectory="${installDir}"
144 iconFile="${installDir}\images\icon.ico"
145 iconIndex="0" />
146 <shortcut
147 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
148 execute="${installDir}\gli\gli.bat"
149 workingDirectory="${installDir}\gli"
150 iconFile="${installDir}\images\icon.ico"
151 iconIndex="0" />
152 <shortcut
153 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
154 execute="${installDir}\gli\gems.bat"
155 workingDirectory="${installDir}\gli"
156 iconFile="${installDir}\images\icon.ico"
157 iconIndex="0" />
158 <shortcut
159 file="${startmenu.path}\Uninstall.lnk"
160 execute="${installDir}\bin\windows\search4j.exe -h packages\jre -l Uninstall.jar"
161 workingDirectory="${installDir}"
162 iconFile="${installDir}\images\icon.ico"
163 iconIndex="0" />
164 <shortcut
165 file="${startmenu.path}\Documentation\READMEen.lnk"
166 execute="${installDir}\READMEen.txt" />
167 <shortcut
168 file="${startmenu.path}\Documentation\READMEes.lnk"
169 execute="${installDir}\READMEes.txt" />
170 <shortcut
171 file="${startmenu.path}\Documentation\READMEar.lnk"
172 execute="${installDir}\READMEar.txt" />
173 <shortcut
174 file="${startmenu.path}\Documentation\READMEfr.lnk"
175 execute="${installDir}\READMEfr.txt" />
176 <shortcut
177 file="${startmenu.path}\Documentation\READMEru.lnk"
178 execute="${installDir}\READMEru.txt" />
179 </target>
180
181 <target name="cleanuptarget"></target>
182
183
184</project>
Note: See TracBrowser for help on using the repository browser.