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

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

dont overwrite startmenu shortcuts for repeat installs unless they are over-installs

File size: 7.4 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 <typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/>
17 <typedef name="getfreepath" classname="GetFreePath" classpathref="project.classpath"/>
18 <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
19 <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" 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 <!-- create the installation directory -->
40 <echo message="Creating Installation directory"/>
41 <echo>basedir: ${basedir}</echo>
42 <echo>installDir: ${installDir}</echo>
43 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
44 <mkdir dir="${installDir}"/>
45
46 <!-- install files -->
47 <echo message="Installing Files"/>
48 <unzip src="${antinstaller.jar}" dest="${installDir}">
49 <patternset>
50
51 <include name="bin/**/*"/>
52 <include name="docs/**/*"/>
53 <include name="gli/**/*"/>
54 <include name="gs2build/**/*"/>
55 <include name="lib/**/*"/>
56 <include name="web/**/*"/>
57 <include name="resources/**/*"/>
58 <include name="winutil/**/*"/>
59
60 <include name="greenstone3-build.xml"/>
61 <include name="build.properties"/>
62 <include name="installation.properties"/>
63 <include name="gs3-server.bat"/>
64 <include name="gs3-setup.bat"/>
65 <include name="LICENSE.txt"/>
66 <include name="README.txt"/>
67 <include name="server.jar"/>
68
69 </patternset>
70 </unzip>
71 <echo/>
72
73 <!-- rename greenstone3-build.xml back to build.xml -->
74 <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
75
76 <!-- change the tomcat ports in build.properties -->
77 <echo message="Changing tomcat ports in build.properties"/>
78 <rsr file="${installDir}/build.properties" pattern="(tomcat.port[=:]).*" replacement="$1${tomcat.port}" />
79 <rsr file="${installDir}/build.properties" pattern="(tomcat.shutdown.port[=:]).*" replacement="$1${tomcat.shutdown.port}" />
80 <echo message="Changing tomcat ports in resources/tomcat/server.xml"/>
81 <copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir.local}/packages/tomcat/conf/server.xml" overwrite="true"/>
82
83 <!-- set gsdlhome in gs2build setup.bat -->
84 <echo message="Setting %GSDLHOME% in gs2build\setup.bat"/>
85 <rsr file="${installDir}/gs2build/setup.bat" pattern="@gsdlhome@" replacement="${installDir.local}\gs2build" />
86
87
88 <!-- copy the greenstone3.xml file to tomcat -->
89 <echo message="Copying greenstone3.xml to tomcat directory"/>
90 <copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
91 <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" />
92
93 <!-- set up global properties -->
94 <echo message="Setting up global properties"/>
95 <copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
96 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
97 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.server@" replacement="${tomcat.server}" />
98 <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.port@" replacement="${tomcat.port}" />
99
100 <!-- set up log4j properties-->
101 <echo message="Setting up log4j properties"/>
102 <copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
103 <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
104
105 <!-- delete unneeded files -->
106 <delete dir="${installDir}/resources/icons"/>
107 <delete file="${installDir}/resources/*.png"/>
108
109 </target>
110
111 <!-- Source -->
112 <target name="install-source-code">
113 <echo message="Installing Source Code (src)"/>
114 <mkdir dir="${installDir}/src"/>
115 <unzip src="${antinstaller.jar}" dest="${installDir}">
116 <patternset>
117 <include name="src/**/*"/>
118 </patternset>
119 </unzip>
120 </target>
121
122 <target name="install-tomcat">
123
124 <echo message="Installing Apache Tomcat"/>
125 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/tomcat/**/*"/></patternset></unzip>
126
127 <!-- change the tomcat ports in tomcats server.xml -->
128 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@server@" replacement="${tomcat.server}" />
129 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@port@" replacement="${tomcat.port}" />
130 <rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" />
131
132 </target>
133 <target name="install-ant">
134 <echo message="Installing Apache Ant"/>
135 <unzip src="${antinstaller.jar}" dest="${installDir}"><patternset><include name="packages/ant/**/*"/></patternset></unzip>
136 </target>
137
138 <target name="cleanuptarget">
139 </target>
140
141 <target name="install-start-menu-shortcuts">
142
143 <!-- figure out the start menu path (if not already set from previous installation) -->
144 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
145
146 <mkdir dir="${startmenu.path}\Documentation"/>
147
148 <shortcut
149 file="${startmenu.path}\Greenstone3 Server.lnk"
150 execute="${installDir}\gs3-server.bat"
151 workingDirectory="${installDir}"
152 iconFile="${installDir}\resources\images\gs3.ico"
153 iconIndex="0" />
154
155 <shortcut
156 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
157 execute="${installDir}\gli\gli.bat"
158 workingDirectory="${installDir}\gli"
159 iconFile="${installDir}\resources\images\gs3.ico"
160 iconIndex="0" />
161
162 <shortcut
163 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
164 execute="${installDir}\gli\gems4gs3.bat"
165 workingDirectory="${installDir}\gli"
166 iconFile="${installDir}\resources\images\gs3.ico"
167 iconIndex="0" />
168
169 <shortcut
170 file="${startmenu.path}\Documentation\README.lnk"
171 execute="${installDir}\README.txt" />
172
173 <shortcut
174 file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
175 execute="${installDir}\documentation\manual\manual.pdf" />
176
177 <shortcut
178 file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
179 execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
180
181 <rsr file="${installDir}\installation.properties" pattern="@startmenu.path@" replacement="${startmenu.path}" winPath="true"/>
182
183 </target>
184
185</project>
Note: See TracBrowser for help on using the repository browser.