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