root/release-kits/wirk3/installer/build.xml @ 17473

Revision 17473, 9.3 KB (checked in by oranfry, 12 years ago)

corrected a startmenu shortcut

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