[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"/>
|
---|
[17468] | 20 | <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
|
---|
[15023] | 21 |
|
---|
[15095] | 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"/>
|
---|
[17370] | 27 | <pathconvert targetos="unix" property="installDir.unix" refid="installDir.path"/>
|
---|
| 28 |
|
---|
[16631] | 29 | <!-- load windows properties -->
|
---|
| 30 | <winprops/>
|
---|
[16930] | 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>
|
---|
[15095] | 38 |
|
---|
[16930] | 39 | <target name="install-core-components" depends="load-previous-props">
|
---|
[15023] | 40 |
|
---|
[17124] | 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 |
|
---|
[15023] | 44 | <echo>basedir: ${basedir}</echo>
|
---|
| 45 | <echo>installDir: ${installDir}</echo>
|
---|
| 46 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
[17124] | 47 | <echo>startmenu.path: ${startmenu.path}</echo>
|
---|
| 48 |
|
---|
| 49 | <!-- create the installation directory -->
|
---|
| 50 | <echo message="Creating Installation directory"/>
|
---|
[15023] | 51 | <mkdir dir="${installDir}"/>
|
---|
[17370] | 52 |
|
---|
| 53 | <!-- extract 7za tool -->
|
---|
| 54 | <unzip src="${antinstaller.jar}" dest="${basedir}">
|
---|
| 55 | <patternset><include name="7za.exe"/></patternset>
|
---|
| 56 | </unzip>
|
---|
[17124] | 57 |
|
---|
[16749] | 58 | <!-- install files -->
|
---|
[17370] | 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"/>
|
---|
[17444] | 65 |
|
---|
| 66 | <!-- jre -->
|
---|
| 67 | <mkdir dir="${installDir}/packages"/>
|
---|
| 68 | <move todir="${installDir}/packages/jre">
|
---|
| 69 | <fileset dir="../@windows-java.extracted@"/>
|
---|
| 70 | </move>
|
---|
| 71 |
|
---|
[15812] | 72 | <!-- rename greenstone3-build.xml back to build.xml -->
|
---|
| 73 | <move file="${installDir}/greenstone3-build.xml" tofile="${installDir}/build.xml" overwrite="true"/>
|
---|
| 74 |
|
---|
[15023] | 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}" />
|
---|
[15356] | 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"/>
|
---|
[15812] | 81 |
|
---|
| 82 | <!-- set gsdlhome in gs2build setup.bat -->
|
---|
| 83 | <echo message="Setting %GSDLHOME% in gs2build\setup.bat"/>
|
---|
[17370] | 84 | <rsr file="${installDir}/gs2build/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir.local}\gs2build" />
|
---|
[15023] | 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"/>
|
---|
[17370] | 88 | <rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" />
|
---|
[15023] | 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"/>
|
---|
[17370] | 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>
|
---|
[15023] | 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"/>
|
---|
[17370] | 102 | <rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.unix}/web"/>
|
---|
[15023] | 103 |
|
---|
| 104 | <!-- delete unneeded files -->
|
---|
| 105 | <delete dir="${installDir}/resources/icons"/>
|
---|
| 106 | <delete file="${installDir}/resources/*.png"/>
|
---|
[17124] | 107 |
|
---|
| 108 | <echo message="Creating installation properties file"/>
|
---|
| 109 | <echo file="${installDir}\installation.properties">startmenu.path:${startmenu.path}</echo>
|
---|
| 110 |
|
---|
[15023] | 111 | </target>
|
---|
| 112 |
|
---|
| 113 | <!-- Source -->
|
---|
[15356] | 114 | <target name="install-source-code">
|
---|
[15023] | 115 | <echo message="Installing Source Code (src)"/>
|
---|
[17370] | 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"/>
|
---|
[15023] | 121 | </target>
|
---|
| 122 |
|
---|
[15356] | 123 | <target name="install-tomcat">
|
---|
| 124 |
|
---|
| 125 | <echo message="Installing Apache Tomcat"/>
|
---|
[17370] | 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 |
|
---|
[15356] | 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>
|
---|
[17370] | 138 |
|
---|
[15356] | 139 | <target name="install-ant">
|
---|
| 140 | <echo message="Installing Apache Ant"/>
|
---|
[17370] | 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"/>
|
---|
[15356] | 146 | </target>
|
---|
[17370] | 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>
|
---|
[15356] | 165 |
|
---|
[15023] | 166 | <target name="cleanuptarget">
|
---|
| 167 | </target>
|
---|
| 168 |
|
---|
[15381] | 169 | <target name="install-start-menu-shortcuts">
|
---|
[15023] | 170 |
|
---|
[16930] | 171 | <mkdir dir="${startmenu.path}\Documentation"/>
|
---|
| 172 |
|
---|
[15381] | 173 | <shortcut
|
---|
[16930] | 174 | file="${startmenu.path}\Greenstone3 Server.lnk"
|
---|
[15691] | 175 | execute="${installDir}\gs3-server.bat"
|
---|
[15381] | 176 | workingDirectory="${installDir}"
|
---|
[15691] | 177 | iconFile="${installDir}\resources\images\gs3.ico"
|
---|
[15381] | 178 | iconIndex="0" />
|
---|
[15691] | 179 |
|
---|
| 180 | <shortcut
|
---|
[16930] | 181 | file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
|
---|
[16284] | 182 | execute="${installDir}\gli\gli.bat"
|
---|
[15691] | 183 | workingDirectory="${installDir}\gli"
|
---|
| 184 | iconFile="${installDir}\resources\images\gs3.ico"
|
---|
| 185 | iconIndex="0" />
|
---|
[15381] | 186 |
|
---|
[15691] | 187 | <shortcut
|
---|
[16930] | 188 | file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
|
---|
[17255] | 189 | execute="${installDir}\gli\gems.bat"
|
---|
[15691] | 190 | workingDirectory="${installDir}\gli"
|
---|
| 191 | iconFile="${installDir}\resources\images\gs3.ico"
|
---|
| 192 | iconIndex="0" />
|
---|
[17257] | 193 |
|
---|
| 194 | <shortcut
|
---|
| 195 | file="${startmenu.path}\Uninstall.lnk"
|
---|
[17339] | 196 | execute="${installDir}\winutil\search4j.exe -h packages\jre -l Uninstall.jar"
|
---|
[17257] | 197 | workingDirectory="${installDir}"
|
---|
[17339] | 198 | iconFile="${installDir}\images\gs3.ico"
|
---|
[17257] | 199 | iconIndex="0" />
|
---|
[17339] | 200 |
|
---|
[15691] | 201 | <shortcut
|
---|
[16930] | 202 | file="${startmenu.path}\Documentation\README.lnk"
|
---|
[15691] | 203 | execute="${installDir}\README.txt" />
|
---|
[16930] | 204 |
|
---|
[15691] | 205 | <shortcut
|
---|
[16930] | 206 | file="${startmenu.path}\Documentation\Greenstone3 Users' Guide.lnk"
|
---|
[15691] | 207 | execute="${installDir}\documentation\manual\manual.pdf" />
|
---|
[16930] | 208 |
|
---|
[15691] | 209 | <shortcut
|
---|
[16930] | 210 | file="${startmenu.path}\Documentation\Greenstone2 Users' Guide.lnk"
|
---|
[15691] | 211 | execute="${installDir}\documentation\manual\gs2_user_en.pdf" />
|
---|
[16930] | 212 |
|
---|
[15381] | 213 | </target>
|
---|
| 214 |
|
---|
[15023] | 215 | </project>
|
---|