[15023] | 1 | <?xml version="1.0"?>
|
---|
| 2 | <!--
|
---|
| 3 | This is the build.xml run by AntInstaller for the installer
|
---|
| 4 | -->
|
---|
| 5 |
|
---|
[16087] | 6 | <project name="Installation">
|
---|
[15023] | 7 |
|
---|
[16931] | 8 | <!-- classpath -->
|
---|
| 9 | <path id="project.classpath"><pathelement path="${antinstaller.jar}"/></path>
|
---|
[15023] | 10 |
|
---|
| 11 | <!-- custom tasks -->
|
---|
[16633] | 12 | <taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
|
---|
| 13 | <taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/>
|
---|
[17107] | 14 | <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
|
---|
| 15 | <typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
|
---|
| 16 | <typedef name="adduser" classname="org.greenstone.anttasks.AddGreenstoneUserToDatabase" classpathref="project.classpath"/>
|
---|
[17413] | 17 | <taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
|
---|
[15023] | 18 |
|
---|
[16931] | 19 | <!-- pick up the properties generated during the install pages -->
|
---|
| 20 | <property file="${basedir}/ant.install.properties"/>
|
---|
| 21 |
|
---|
| 22 | <!-- determine if there is an existing installation in the installDir-->
|
---|
| 23 | <available file="${installDir}\etc\installation.properties" property="is.overinstall"/>
|
---|
[15023] | 24 |
|
---|
[16633] | 25 | <!-- load windows properties -->
|
---|
| 26 | <winprops/>
|
---|
[16931] | 27 |
|
---|
| 28 | <!-- create a local installDir String -->
|
---|
| 29 | <path id="installDir.path"><pathelement location="${installDir}"/></path>
|
---|
| 30 | <property name="installDir.local" refid="installDir.path"/>
|
---|
| 31 |
|
---|
| 32 | <target name="load-previous-props" if="is.overinstall">
|
---|
| 33 | <property file="${installDir}\etc\installation.properties"/>
|
---|
| 34 | </target>
|
---|
[16087] | 35 |
|
---|
[16931] | 36 | <target name="install-core-components" depends="load-previous-props">
|
---|
[16087] | 37 |
|
---|
[17125] | 38 | <!-- figure out the start menu path (if not already set from previous installation) -->
|
---|
| 39 | <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
|
---|
| 40 |
|
---|
[15023] | 41 | <echo>basedir: ${basedir}</echo>
|
---|
| 42 | <echo>installDir: ${installDir}</echo>
|
---|
| 43 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
[17125] | 44 | <echo>startmenu.path: ${startmenu.path}</echo>
|
---|
[16087] | 45 |
|
---|
| 46 | <!-- create the installation directory -->
|
---|
| 47 | <echo message="Creating Installation directory"/>
|
---|
[15023] | 48 | <mkdir dir="${installDir}"/>
|
---|
[17413] | 49 |
|
---|
[17381] | 50 | <!-- extract 7za tool -->
|
---|
| 51 | <unzip src="${antinstaller.jar}" dest="${basedir}">
|
---|
| 52 | <patternset><include name="7za.exe"/></patternset>
|
---|
[15023] | 53 | </unzip>
|
---|
[17413] | 54 |
|
---|
[17381] | 55 | <!-- install files -->
|
---|
| 56 | <echo message="Installing Core Component"/>
|
---|
| 57 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
|
---|
| 58 | <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec>
|
---|
[17413] | 59 | <!--<sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>-->
|
---|
[17381] | 60 | <delete file="core.lzma"/>
|
---|
| 61 | <unzip src="${basedir}/core.comp" dest="${installDir}"/>
|
---|
| 62 | <delete file="core.comp"/>
|
---|
[17444] | 63 |
|
---|
| 64 | <!-- jre -->
|
---|
| 65 | <mkdir dir="${installDir}/packages"/>
|
---|
| 66 | <move todir="${installDir}/packages/jre">
|
---|
| 67 | <fileset dir="../@windows-java.extracted@"/>
|
---|
| 68 | </move>
|
---|
[17381] | 69 |
|
---|
[17107] | 70 | <echo message="Creating admin and demo users"/>
|
---|
[17311] | 71 | <adduser
|
---|
| 72 | txt2db="${installDir}/bin/windows/txt2db"
|
---|
[17107] | 73 | usersDb="${installDir}/etc/users.db"
|
---|
| 74 | username="admin"
|
---|
| 75 | password="${admin.password}"
|
---|
| 76 | groups="administrator,colbuilder"
|
---|
| 77 | comment="created at install time"/>
|
---|
| 78 | <adduser
|
---|
[17119] | 79 | txt2db="${installDir}/bin/windows/txt2db"
|
---|
[17107] | 80 | usersDb="${installDir}/etc/users.db"
|
---|
| 81 | username="demo"
|
---|
| 82 | password="demo"
|
---|
| 83 | groups="demo"
|
---|
| 84 | comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
|
---|
| 85 |
|
---|
[17437] | 86 | <echo message="Installing Servers"/>
|
---|
| 87 | <copy todir="${installDir}" file="${installDir}/bin/windows/server.exe"/>
|
---|
| 88 | <copy tofile="${installDir}/cgi-bin/oaiserver" file="${installDir}/bin/windows/oaiserver.exe"/>
|
---|
| 89 | <copy tofile="${installDir}/cgi-bin/library" file="${installDir}/bin/windows/library.exe"/>
|
---|
[16774] | 90 |
|
---|
[17074] | 91 | <echo message="Filling in concrete values in config files"/>
|
---|
[17311] | 92 | <rsr file="${installDir}/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
| 93 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
|
---|
| 94 | <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
| 95 | <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
|
---|
| 96 | <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
|
---|
| 97 | </rsr>
|
---|
[17080] | 98 | <rsr file="${installDir}/gsdlsite.cfg" pattern="@gsdlhome@" replacement="${installDir}"/>
|
---|
| 99 |
|
---|
[16948] | 100 | <echo message="Creating installation properties file"/>
|
---|
[17125] | 101 | <echo file="${installDir}\etc\installation.properties">startmenu.path:${startmenu.path}</echo>
|
---|
| 102 |
|
---|
[16087] | 103 | <echo message="Finished"/>
|
---|
[16633] | 104 |
|
---|
[15023] | 105 | </target>
|
---|
| 106 |
|
---|
| 107 | <!-- Source -->
|
---|
[16087] | 108 | <target name="install-source-code" depends="">
|
---|
[16817] | 109 | <echo message="Installing Source Code"/>
|
---|
[17381] | 110 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
|
---|
| 111 | <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x sourcecode.lzma"/></exec>
|
---|
[17413] | 112 | <!--<sevenzip task="decode" input="${basedir}/sourcecode.lzma" output="${basedir}/sourcecode.comp"/>-->
|
---|
[17381] | 113 | <delete file="sourcecode.lzma"/>
|
---|
| 114 | <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
|
---|
| 115 | <delete file="sourcecode.comp"/>
|
---|
[15023] | 116 | </target>
|
---|
[17311] | 117 |
|
---|
[17381] | 118 | <target name="install-imagemagick">
|
---|
| 119 | <echo message="Installing ImageMagick"/>
|
---|
| 120 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
| 121 | <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec>
|
---|
[17413] | 122 | <!--<sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>-->
|
---|
[17381] | 123 | <delete file="imagemagick.lzma"/>
|
---|
| 124 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/windows"/>
|
---|
| 125 | <delete file="imagemagick.comp"/>
|
---|
| 126 | </target>
|
---|
| 127 |
|
---|
| 128 | <target name="install-ghostscript">
|
---|
| 129 | <echo message="Installing GhostScript"/>
|
---|
| 130 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
|
---|
| 131 | <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec>
|
---|
[17413] | 132 | <!--<sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>-->
|
---|
[17381] | 133 | <delete file="ghostscript.lzma"/>
|
---|
| 134 | <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/windows"/>
|
---|
| 135 | <delete file="ghostscript.comp"/>
|
---|
| 136 | </target>
|
---|
| 137 |
|
---|
[16633] | 138 | <!-- Start menu shortcuts -->
|
---|
| 139 | <target name="install-start-menu-shortcuts">
|
---|
[15023] | 140 |
|
---|
[16917] | 141 | <mkdir dir="${startmenu.path}\Documentation"/>
|
---|
| 142 |
|
---|
[16633] | 143 | <shortcut
|
---|
[16917] | 144 | file="${startmenu.path}\Greenstone2 Server.lnk"
|
---|
[16774] | 145 | execute="${installDir}\server.exe"
|
---|
[16633] | 146 | workingDirectory="${installDir}"
|
---|
| 147 | iconFile="${installDir}\images\icon.ico"
|
---|
| 148 | iconIndex="0" />
|
---|
| 149 | <shortcut
|
---|
[16917] | 150 | file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
|
---|
[16633] | 151 | execute="${installDir}\gli\gli.bat"
|
---|
| 152 | workingDirectory="${installDir}\gli"
|
---|
| 153 | iconFile="${installDir}\images\icon.ico"
|
---|
| 154 | iconIndex="0" />
|
---|
| 155 | <shortcut
|
---|
[16917] | 156 | file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
|
---|
[17381] | 157 | execute="${installDir}\gli\gems.bat"
|
---|
[16633] | 158 | workingDirectory="${installDir}\gli"
|
---|
| 159 | iconFile="${installDir}\images\icon.ico"
|
---|
| 160 | iconIndex="0" />
|
---|
| 161 | <shortcut
|
---|
[17257] | 162 | file="${startmenu.path}\Uninstall.lnk"
|
---|
[17436] | 163 | execute="${installDir}\Uninstall.bat"
|
---|
[17257] | 164 | workingDirectory="${installDir}"
|
---|
| 165 | iconFile="${installDir}\images\icon.ico"
|
---|
| 166 | iconIndex="0" />
|
---|
| 167 | <shortcut
|
---|
[16917] | 168 | file="${startmenu.path}\Documentation\READMEen.lnk"
|
---|
[16633] | 169 | execute="${installDir}\READMEen.txt" />
|
---|
| 170 | <shortcut
|
---|
[16917] | 171 | file="${startmenu.path}\Documentation\READMEes.lnk"
|
---|
[16633] | 172 | execute="${installDir}\READMEes.txt" />
|
---|
| 173 | <shortcut
|
---|
[16917] | 174 | file="${startmenu.path}\Documentation\READMEar.lnk"
|
---|
[16633] | 175 | execute="${installDir}\READMEar.txt" />
|
---|
| 176 | <shortcut
|
---|
[16917] | 177 | file="${startmenu.path}\Documentation\READMEfr.lnk"
|
---|
[16633] | 178 | execute="${installDir}\READMEfr.txt" />
|
---|
| 179 | <shortcut
|
---|
[16917] | 180 | file="${startmenu.path}\Documentation\READMEru.lnk"
|
---|
[16633] | 181 | execute="${installDir}\READMEru.txt" />
|
---|
[15023] | 182 | </target>
|
---|
[16633] | 183 |
|
---|
| 184 | <target name="cleanuptarget"></target>
|
---|
[15023] | 185 |
|
---|
| 186 |
|
---|
| 187 | </project>
|
---|