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

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

untested changes to exclude sourcecode from the binary release, use nicer target names and icons

File size: 9.2 KB
RevLine 
[15023]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 -->
[15381]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"/>
[17107]18 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
19 <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
[17477]20
[15095]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"/>
[17370]26 <pathconvert targetos="unix" property="installDir.unix" refid="installDir.path"/>
27
[16631]28 <!-- load windows properties -->
29 <winprops/>
[16930]30
31 <!-- determine if there is an existing installation in the installDir-->
32 <available file="${installDir}\installation.properties" property="is.overinstall"/>
33
[17597]34 <target name="Looking For Previous Installation" if="is.overinstall">
35 <property file="${installDir}\etc\installation.properties"/>
[16930]36 </target>
[15095]37
[17597]38 <target name="Installing Core System">
[15023]39
[17124]40 <!-- figure out the start menu path (if not already set from previous installation) -->
41 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
42
[15023]43 <echo>basedir: ${basedir}</echo>
44 <echo>installDir: ${installDir}</echo>
45 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
[17124]46 <echo>startmenu.path: ${startmenu.path}</echo>
47
48 <!-- create the installation directory -->
49 <echo message="Creating Installation directory"/>
[15023]50 <mkdir dir="${installDir}"/>
[17370]51
52 <!-- extract 7za tool -->
53 <unzip src="${antinstaller.jar}" dest="${basedir}">
54 <patternset><include name="7za.exe"/></patternset>
55 </unzip>
[17124]56
[16749]57 <!-- install files -->
[17370]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 <delete file="core.lzma"/>
62 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
63 <delete file="core.comp"/>
[17444]64
65 <!-- jre -->
66 <mkdir dir="${installDir}/packages"/>
[17470]67 <copy todir="${installDir}/packages/jre">
[17444]68 <fileset dir="../@windows-java.extracted@"/>
[17470]69 </copy>
[17444]70
[15812]71 <!-- rename greenstone3-build.xml back to build.xml -->
72 <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
73
[15023]74 <!-- change the tomcat ports in build.properties -->
75 <echo message="Changing tomcat ports in build.properties"/>
76 <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
77 <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
[15356]78 <echo message="Changing tomcat ports in resources/tomcat/server.xml"/>
79 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir.local}/packages/tomcat/conf/server.xml" overwrite="true"/>
[15812]80
81 <!-- set gsdlhome in gs2build setup.bat -->
82 <echo message="Setting %GSDLHOME% in gs2build\setup.bat"/>
[17370]83 <rsr file="${installDir}/gs2build/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir.local}\gs2build" />
[15023]84 <!-- copy the greenstone3.xml file to tomcat -->
85 <echo message="Copying greenstone3.xml to tomcat directory"/>
86 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
[17370]87 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" />
[15023]88
89 <!-- set up global properties -->
90 <echo message="Setting up global properties"/>
91 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
[17370]92 <rsr file="${installDir}/web/WEB-INF/classes/global.properties">
93 <job pattern="@gsdl3home@" replacement="${installDir.unix}/web" />
94 <job pattern="@tomcat.server@" replacement="${tomcat.server}" />
95 <job pattern="@tomcat.port@" replacement="${tomcat.port}" />
96 </rsr>
[15023]97
98 <!-- set up log4j properties-->
99 <echo message="Setting up log4j properties"/>
100 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
[17370]101 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.unix}/web"/>
[15023]102
103 <!-- delete unneeded files -->
104 <delete dir="${installDir}/resources/icons"/>
105 <delete file="${installDir}/resources/*.png"/>
[17124]106
107 <echo message="Creating installation properties file"/>
108 <echo file="${installDir}\installation.properties">startmenu.path:${startmenu.path}</echo>
109
[15023]110 </target>
111
112 <!-- Source -->
[17597]113 <target name="Installing Source Code">
[15023]114 <echo message="Installing Source Code (src)"/>
[17370]115 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
116 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x sourcecode.lzma"/></exec>
117 <delete file="sourcecode.lzma"/>
118 <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
119 <delete file="sourcecode.comp"/>
[15023]120 </target>
121
[17597]122 <target name="Installing Tomcat">
[15356]123
124 <echo message="Installing Apache Tomcat"/>
[17370]125 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="tomcat.lzma"/></patternset></unzip>
126 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x tomcat.lzma"/></exec>
127 <delete file="tomcat.lzma"/>
128 <unzip src="${basedir}/tomcat.comp" dest="${installDir}/packages"/>
129 <delete file="tomcat.comp"/>
130
[15356]131 <!-- change the tomcat ports in tomcats server.xml -->
132 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@server@" replacement="${tomcat.server}" />
133 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@port@" replacement="${tomcat.port}" />
134 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" />
135
136 </target>
[17370]137
[17597]138 <target name="Installing Ant">
[15356]139 <echo message="Installing Apache Ant"/>
[17370]140 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ant.lzma"/></patternset></unzip>
141 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ant.lzma"/></exec>
142 <delete file="ant.lzma"/>
143 <unzip src="${basedir}/ant.comp" dest="${installDir}/packages"/>
144 <delete file="ant.comp"/>
[15356]145 </target>
[17370]146
[17597]147 <target name="Installing ImageMagick">
[17370]148 <echo message="Installing ImageMagick"/>
149 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
150 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec>
151 <delete file="imagemagick.lzma"/>
152 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/gs2build/bin/windows"/>
153 <delete file="imagemagick.comp"/>
154 </target>
155
[17597]156 <target name="Installing Ghostscript">
[17370]157 <echo message="Installing GhostScript"/>
158 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
159 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec>
160 <delete file="ghostscript.lzma"/>
161 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/gs2build/bin/windows"/>
162 <delete file="ghostscript.comp"/>
163 </target>
[15356]164
[17597]165 <target name="Installing Start Menu Shortcuts">
[15023]166
[16930]167 <mkdir dir="${startmenu.path}\Documentation"/>
168
[15381]169 <shortcut
[16930]170 file="${startmenu.path}\Greenstone3 Server.lnk"
[15691]171 execute="${installDir}\gs3-server.bat"
[15381]172 workingDirectory="${installDir}"
[15691]173 iconFile="${installDir}\resources\images\gs3.ico"
[15381]174 iconIndex="0" />
[15691]175
176 <shortcut
[16930]177 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
[16284]178 execute="${installDir}\gli\gli.bat"
[15691]179 workingDirectory="${installDir}\gli"
180 iconFile="${installDir}\resources\images\gs3.ico"
181 iconIndex="0" />
[15381]182
[15691]183 <shortcut
[16930]184 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
[17255]185 execute="${installDir}\gli\gems.bat"
[15691]186 workingDirectory="${installDir}\gli"
187 iconFile="${installDir}\resources\images\gs3.ico"
188 iconIndex="0" />
[17257]189
190 <shortcut
191 file="${startmenu.path}\Uninstall.lnk"
[17473]192 execute="${installDir}\Uninstall.bat"
[17257]193 workingDirectory="${installDir}"
[17339]194 iconFile="${installDir}\images\gs3.ico"
[17257]195 iconIndex="0" />
[17339]196
[15691]197 <shortcut
[16930]198 file="${startmenu.path}\Documentation\README.lnk"
[15691]199 execute="${installDir}\README.txt" />
[16930]200
[15691]201 <shortcut
[16930]202 file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
[15691]203 execute="${installDir}\documentation\manual\manual.pdf" />
[16930]204
[15691]205 <shortcut
[16930]206 file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
[15691]207 execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
[16930]208
[15381]209 </target>
210
[15023]211</project>
Note: See TracBrowser for help on using the repository browser.