source: release-kits/wirk3/installer/build.xml@ 17257

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

added the uninstaller to all release kits

File size: 8.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" default="" basedir="${basedir}">
7
8 <!-- this is required to pick up the properties generated during the install pages -->
9 <property file="${basedir}/ant.install.properties"/>
10
11 <path id="project.classpath">
12 <pathelement path="${antinstaller.jar}"/>
13 </path>
14
15 <!-- custom tasks -->
16 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
17 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
18 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
19 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
20
21 <!-- create a local installDir String -->
22 <path id="installDir.path">
23 <pathelement location="${installDir}"/>
24 </path>
25 <property name="installDir.local" refid="installDir.path"/>
26
27 <!-- load windows properties -->
28 <winprops/>
29
30 <!-- determine if there is an existing installation in the installDir-->
31 <available file="${installDir}\installation.properties" property="is.overinstall"/>
32
33 <target name="load-previous-props" if="is.overinstall">
34 <property file="${installDir}\installation.properties"/>
35 </target>
36
37 <target name="install-core-components" depends="load-previous-props">
38
39 <!-- figure out the start menu path (if not already set from previous installation) -->
40 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
41
42 <echo>basedir: ${basedir}</echo>
43 <echo>installDir: ${installDir}</echo>
44 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
45 <echo>startmenu.path: ${startmenu.path}</echo>
46
47 <!-- create the installation directory -->
48 <echo message="Creating Installation directory"/>
49 <mkdir dir="${installDir}"/>
50
51 <!-- install files -->
52 <echo message="Installing Files"/>
53 <unzip src="${antinstaller.jar}" dest="${installDir}">
54 <patternset>
55
56 <include name="bin/**/*"/>
57 <include name="docs/**/*"/>
58 <include name="gli/**/*"/>
59 <include name="gs2build/**/*"/>
60 <exclude name="gs2build/common-src/**/*"/>
61 <exclude name="gs2build/build-src/**/*"/>
62 <exclude name="gs2build/runtime-src/**/*"/>
63 <include name="lib/**/*"/>
64 <include name="web/**/*"/>
65 <include name="resources/**/*"/>
66 <include name="winutil/**/*"/>
67
68 <include name="greenstone3-build.xml"/>
69 <include name="build.properties"/>
70 <include name="gs3-server.bat"/>
71 <include name="gs3-setup.bat"/>
72 <include name="LICENSE.txt"/>
73 <include name="README.txt"/>
74 <include name="server.jar"/>
75 <include name="Uninstall.jar"/>
76 </patternset>
77 </unzip>
78 <echo/>
79
80 <!-- rename greenstone3-build.xml back to build.xml -->
81 <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
82
83 <!-- change the tomcat ports in build.properties -->
84 <echo message="Changing tomcat ports in build.properties"/>
85 <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
86 <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
87 <echo message="Changing tomcat ports in resources/tomcat/server.xml"/>
88 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir.local}/packages/tomcat/conf/server.xml" overwrite="true"/>
89
90 <!-- set gsdlhome in gs2build setup.bat -->
91 <echo message="Setting %GSDLHOME% in gs2build\setup.bat"/>
92 <rsr file="${installDir}/gs2build/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir.local}\gs2build" winPath="true"/>
93 <!-- copy the greenstone3.xml file to tomcat -->
94 <echo message="Copying greenstone3.xml to tomcat directory"/>
95 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
96 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" winPath="true" />
97
98 <!-- set up global properties -->
99 <echo message="Setting up global properties"/>
100 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
101 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" winPath="true" />
102 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.server@" replacement="${tomcat.server}" />
103 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.port@" replacement="${tomcat.port}" />
104
105 <!-- set up log4j properties-->
106 <echo message="Setting up log4j properties"/>
107 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
108 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" winPath="true" />
109
110 <!-- delete unneeded files -->
111 <delete dir="${installDir}/resources/icons"/>
112 <delete file="${installDir}/resources/*.png"/>
113
114 <echo message="Creating installation properties file"/>
115 <echo file="${installDir}\installation.properties">startmenu.path:${startmenu.path}</echo>
116
117 </target>
118
119 <!-- Source -->
120 <target name="install-source-code">
121 <echo message="Installing Source Code (src)"/>
122 <mkdir dir="${installDir}/src"/>
123 <unzip src="${antinstaller.jar}" dest="${installDir}">
124 <patternset>
125 <include name="src/**/*"/>
126 <include name="gs2build/common-src/**/*"/>
127 <include name="gs2build/build-src/**/*"/>
128 <include name="gs2build/runtime-src/**/*"/>
129 </patternset>
130 </unzip>
131 </target>
132
133 <target name="install-tomcat">
134
135 <echo message="Installing Apache Tomcat"/>
136 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/tomcat/**/*"/></patternset></unzip>
137
138 <!-- change the tomcat ports in tomcats server.xml -->
139 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@server@" replacement="${tomcat.server}" />
140 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@port@" replacement="${tomcat.port}" />
141 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" />
142
143 </target>
144 <target name="install-ant">
145 <echo message="Installing Apache Ant"/>
146 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/ant/**/*"/></patternset></unzip>
147 </target>
148
149 <target name="cleanuptarget">
150 </target>
151
152 <target name="install-start-menu-shortcuts">
153
154 <mkdir dir="${startmenu.path}\Documentation"/>
155
156 <shortcut
157 file="${startmenu.path}\Greenstone3 Server.lnk"
158 execute="${installDir}\gs3-server.bat"
159 workingDirectory="${installDir}"
160 iconFile="${installDir}\resources\images\gs3.ico"
161 iconIndex="0" />
162
163 <shortcut
164 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
165 execute="${installDir}\gli\gli.bat"
166 workingDirectory="${installDir}\gli"
167 iconFile="${installDir}\resources\images\gs3.ico"
168 iconIndex="0" />
169
170 <shortcut
171 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
172 execute="${installDir}\gli\gems.bat"
173 workingDirectory="${installDir}\gli"
174 iconFile="${installDir}\resources\images\gs3.ico"
175 iconIndex="0" />
176
177 <shortcut
178 file="${startmenu.path}\Uninstall.lnk"
179 execute="${installDir}\winutil\search4j.exe -h packages\jre -l Uninstaller.jar"
180 workingDirectory="${installDir}"
181 iconFile="${installDir}\images\icon.ico"
182 iconIndex="0" />
183
184
185 <shortcut
186 file="${startmenu.path}\Documentation\README.lnk"
187 execute="${installDir}\README.txt" />
188
189 <shortcut
190 file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
191 execute="${installDir}\documentation\manual\manual.pdf" />
192
193 <shortcut
194 file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
195 execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
196
197 </target>
198
199</project>
Note: See TracBrowser for help on using the repository browser.