[15023] | 1 | <?xml version="1.0"?>
|
---|
| 2 | <!--
|
---|
| 3 | This 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"/>
|
---|
[15023] | 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"/>
|
---|
[16631] | 26 |
|
---|
| 27 | <!-- load windows properties -->
|
---|
| 28 | <winprops/>
|
---|
[16930] | 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>
|
---|
[15095] | 36 |
|
---|
[16930] | 37 | <target name="install-core-components" depends="load-previous-props">
|
---|
[15023] | 38 |
|
---|
[17124] | 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 |
|
---|
[15023] | 42 | <echo>basedir: ${basedir}</echo>
|
---|
| 43 | <echo>installDir: ${installDir}</echo>
|
---|
| 44 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
[17124] | 45 | <echo>startmenu.path: ${startmenu.path}</echo>
|
---|
| 46 |
|
---|
| 47 | <!-- create the installation directory -->
|
---|
| 48 | <echo message="Creating Installation directory"/>
|
---|
[15023] | 49 | <mkdir dir="${installDir}"/>
|
---|
[17124] | 50 |
|
---|
[16749] | 51 | <!-- install files -->
|
---|
| 52 | <echo message="Installing Files"/>
|
---|
| 53 | <unzip src="${antinstaller.jar}" dest="${installDir}">
|
---|
| 54 | <patternset>
|
---|
[15023] | 55 |
|
---|
[16749] | 56 | <include name="bin/**/*"/>
|
---|
| 57 | <include name="docs/**/*"/>
|
---|
| 58 | <include name="gli/**/*"/>
|
---|
| 59 | <include name="gs2build/**/*"/>
|
---|
[17050] | 60 | <exclude name="gs2build/common-src/**/*"/>
|
---|
| 61 | <exclude name="gs2build/build-src/**/*"/>
|
---|
| 62 | <exclude name="gs2build/runtime-src/**/*"/>
|
---|
[16749] | 63 | <include name="lib/**/*"/>
|
---|
| 64 | <include name="web/**/*"/>
|
---|
| 65 | <include name="resources/**/*"/>
|
---|
| 66 | <include name="winutil/**/*"/>
|
---|
[15023] | 67 |
|
---|
[15812] | 68 | <include name="greenstone3-build.xml"/>
|
---|
[15023] | 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"/>
|
---|
[17257] | 75 | <include name="Uninstall.jar"/>
|
---|
[15023] | 76 | </patternset>
|
---|
| 77 | </unzip>
|
---|
| 78 | <echo/>
|
---|
[17124] | 79 |
|
---|
[15812] | 80 | <!-- rename greenstone3-build.xml back to build.xml -->
|
---|
| 81 | <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
|
---|
| 82 |
|
---|
[15023] | 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}" />
|
---|
[15356] | 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"/>
|
---|
[15812] | 89 |
|
---|
| 90 | <!-- set gsdlhome in gs2build setup.bat -->
|
---|
| 91 | <echo message="Setting %GSDLHOME% in gs2build\setup.bat"/>
|
---|
[17239] | 92 | <rsr file="${installDir}/gs2build/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir.local}\gs2build" winPath="true"/>
|
---|
[15023] | 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"/>
|
---|
[17239] | 96 | <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" winPath="true" />
|
---|
[15023] | 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"/>
|
---|
[17239] | 101 | <rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" winPath="true" />
|
---|
[15095] | 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}" />
|
---|
[15023] | 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"/>
|
---|
[17239] | 108 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" winPath="true" />
|
---|
[15023] | 109 |
|
---|
| 110 | <!-- delete unneeded files -->
|
---|
| 111 | <delete dir="${installDir}/resources/icons"/>
|
---|
| 112 | <delete file="${installDir}/resources/*.png"/>
|
---|
[17124] | 113 |
|
---|
| 114 | <echo message="Creating installation properties file"/>
|
---|
| 115 | <echo file="${installDir}\installation.properties">startmenu.path:${startmenu.path}</echo>
|
---|
| 116 |
|
---|
[15023] | 117 | </target>
|
---|
| 118 |
|
---|
| 119 | <!-- Source -->
|
---|
[15356] | 120 | <target name="install-source-code">
|
---|
[15023] | 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/**/*"/>
|
---|
[17050] | 126 | <include name="gs2build/common-src/**/*"/>
|
---|
| 127 | <include name="gs2build/build-src/**/*"/>
|
---|
| 128 | <include name="gs2build/runtime-src/**/*"/>
|
---|
[15023] | 129 | </patternset>
|
---|
| 130 | </unzip>
|
---|
| 131 | </target>
|
---|
| 132 |
|
---|
[15356] | 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 |
|
---|
[17339] | 149 | <target name="install-jre">
|
---|
| 150 | <echo>Installing Java Runtime Environment</echo>
|
---|
| 151 | <mkdir dir="${installDir}/packages"/>
|
---|
| 152 | <copy todir="${installDir}/packages/jre">
|
---|
| 153 | <fileset dir="../@java.extracted@"/>
|
---|
| 154 | </copy>
|
---|
| 155 | </target>
|
---|
| 156 |
|
---|
[15023] | 157 | <target name="cleanuptarget">
|
---|
| 158 | </target>
|
---|
| 159 |
|
---|
[15381] | 160 | <target name="install-start-menu-shortcuts">
|
---|
[15023] | 161 |
|
---|
[16930] | 162 | <mkdir dir="${startmenu.path}\Documentation"/>
|
---|
| 163 |
|
---|
[15381] | 164 | <shortcut
|
---|
[16930] | 165 | file="${startmenu.path}\Greenstone3 Server.lnk"
|
---|
[15691] | 166 | execute="${installDir}\gs3-server.bat"
|
---|
[15381] | 167 | workingDirectory="${installDir}"
|
---|
[15691] | 168 | iconFile="${installDir}\resources\images\gs3.ico"
|
---|
[15381] | 169 | iconIndex="0" />
|
---|
[15691] | 170 |
|
---|
| 171 | <shortcut
|
---|
[16930] | 172 | file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
|
---|
[16284] | 173 | execute="${installDir}\gli\gli.bat"
|
---|
[15691] | 174 | workingDirectory="${installDir}\gli"
|
---|
| 175 | iconFile="${installDir}\resources\images\gs3.ico"
|
---|
| 176 | iconIndex="0" />
|
---|
[15381] | 177 |
|
---|
[15691] | 178 | <shortcut
|
---|
[16930] | 179 | file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
|
---|
[17255] | 180 | execute="${installDir}\gli\gems.bat"
|
---|
[15691] | 181 | workingDirectory="${installDir}\gli"
|
---|
| 182 | iconFile="${installDir}\resources\images\gs3.ico"
|
---|
| 183 | iconIndex="0" />
|
---|
[17257] | 184 |
|
---|
| 185 | <shortcut
|
---|
| 186 | file="${startmenu.path}\Uninstall.lnk"
|
---|
[17339] | 187 | execute="${installDir}\winutil\search4j.exe -h packages\jre -l Uninstall.jar"
|
---|
[17257] | 188 | workingDirectory="${installDir}"
|
---|
[17339] | 189 | iconFile="${installDir}\images\gs3.ico"
|
---|
[17257] | 190 | iconIndex="0" />
|
---|
[17339] | 191 |
|
---|
[15691] | 192 | <shortcut
|
---|
[16930] | 193 | file="${startmenu.path}\Documentation\README.lnk"
|
---|
[15691] | 194 | execute="${installDir}\README.txt" />
|
---|
[16930] | 195 |
|
---|
[15691] | 196 | <shortcut
|
---|
[16930] | 197 | file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
|
---|
[15691] | 198 | execute="${installDir}\documentation\manual\manual.pdf" />
|
---|
[16930] | 199 |
|
---|
[15691] | 200 | <shortcut
|
---|
[16930] | 201 | file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
|
---|
[15691] | 202 | execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
|
---|
[16930] | 203 |
|
---|
[15381] | 204 | </target>
|
---|
| 205 |
|
---|
[15023] | 206 | </project>
|
---|