[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"/>
|
---|
[17478] | 17 |
|
---|
[16931] | 18 | <!-- pick up the properties generated during the install pages -->
|
---|
| 19 | <property file="${basedir}/ant.install.properties"/>
|
---|
| 20 |
|
---|
| 21 | <!-- determine if there is an existing installation in the installDir-->
|
---|
| 22 | <available file="${installDir}\etc\installation.properties" property="is.overinstall"/>
|
---|
[15023] | 23 |
|
---|
[16633] | 24 | <!-- load windows properties -->
|
---|
| 25 | <winprops/>
|
---|
[16931] | 26 |
|
---|
| 27 | <!-- create a local installDir String -->
|
---|
| 28 | <path id="installDir.path"><pathelement location="${installDir}"/></path>
|
---|
| 29 | <property name="installDir.local" refid="installDir.path"/>
|
---|
| 30 |
|
---|
[17583] | 31 | <target name="Looking For Previous Installation" if="is.overinstall">
|
---|
[16931] | 32 | <property file="${installDir}\etc\installation.properties"/>
|
---|
[17638] | 33 | <delete dir="${installed.startmenu.path}" failonerror="false"/>
|
---|
[16931] | 34 | </target>
|
---|
[16087] | 35 |
|
---|
[17583] | 36 | <target name="Installing Core System">
|
---|
[16087] | 37 |
|
---|
[17652] | 38 | <!-- figure out the start menu path -->
|
---|
[17125] | 39 | <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
|
---|
[17638] | 40 | <path id="startmenu.path.path" path="${startmenu.path}"/>
|
---|
| 41 | <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
|
---|
| 42 |
|
---|
[15023] | 43 | <echo>basedir: ${basedir}</echo>
|
---|
| 44 | <echo>installDir: ${installDir}</echo>
|
---|
| 45 | <echo>antinstaller.jar: ${antinstaller.jar}</echo>
|
---|
[17125] | 46 | <echo>startmenu.path: ${startmenu.path}</echo>
|
---|
[16087] | 47 |
|
---|
| 48 | <!-- create the installation directory -->
|
---|
| 49 | <echo message="Creating Installation directory"/>
|
---|
[15023] | 50 | <mkdir dir="${installDir}"/>
|
---|
[17413] | 51 |
|
---|
[17381] | 52 | <!-- extract 7za tool -->
|
---|
| 53 | <unzip src="${antinstaller.jar}" dest="${basedir}">
|
---|
| 54 | <patternset><include name="7za.exe"/></patternset>
|
---|
[15023] | 55 | </unzip>
|
---|
[17413] | 56 |
|
---|
[17381] | 57 | <!-- install files -->
|
---|
| 58 | <echo message="Installing Core Component"/>
|
---|
| 59 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
|
---|
| 60 | <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec>
|
---|
[17413] | 61 | <!--<sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>-->
|
---|
[17381] | 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"/>
|
---|
[17583] | 68 | <copy todir="${installDir}/packages/jre" failonerror="false">
|
---|
[17444] | 69 | <fileset dir="../@windows-java.extracted@"/>
|
---|
[17470] | 70 | </copy>
|
---|
[17381] | 71 |
|
---|
[17107] | 72 | <echo message="Creating admin and demo users"/>
|
---|
[17311] | 73 | <adduser
|
---|
| 74 | txt2db="${installDir}/bin/windows/txt2db"
|
---|
[17107] | 75 | usersDb="${installDir}/etc/users.db"
|
---|
| 76 | username="admin"
|
---|
| 77 | password="${admin.password}"
|
---|
| 78 | groups="administrator,colbuilder"
|
---|
| 79 | comment="created at install time"/>
|
---|
| 80 | <adduser
|
---|
[17119] | 81 | txt2db="${installDir}/bin/windows/txt2db"
|
---|
[17107] | 82 | usersDb="${installDir}/etc/users.db"
|
---|
| 83 | username="demo"
|
---|
| 84 | password="demo"
|
---|
| 85 | groups="demo"
|
---|
| 86 | comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
|
---|
| 87 |
|
---|
[17437] | 88 | <echo message="Installing Servers"/>
|
---|
| 89 | <copy todir="${installDir}" file="${installDir}/bin/windows/server.exe"/>
|
---|
| 90 | <copy tofile="${installDir}/cgi-bin/oaiserver" file="${installDir}/bin/windows/oaiserver.exe"/>
|
---|
| 91 | <copy tofile="${installDir}/cgi-bin/library" file="${installDir}/bin/windows/library.exe"/>
|
---|
[16774] | 92 |
|
---|
[18154] | 93 | <!--Don't need to change these values anymore-->
|
---|
| 94 | <!-- <echo message="Filling in concrete values in config files"/>
|
---|
[17311] | 95 | <rsr file="${installDir}/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
| 96 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
|
---|
| 97 | <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
| 98 | <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
|
---|
| 99 | <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
|
---|
| 100 | </rsr>
|
---|
[18154] | 101 | <rsr file="${installDir}/gsdlsite.cfg" pattern="@gsdlhome@" replacement="${installDir}"/>-->
|
---|
[17814] | 102 |
|
---|
[16948] | 103 | <echo message="Creating installation properties file"/>
|
---|
[17638] | 104 | <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
|
---|
[17125] | 105 |
|
---|
[16087] | 106 | <echo message="Finished"/>
|
---|
[16633] | 107 |
|
---|
[15023] | 108 | </target>
|
---|
| 109 |
|
---|
[17583] | 110 | <target name="Installing ImageMagick">
|
---|
[17381] | 111 | <echo message="Installing ImageMagick"/>
|
---|
| 112 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
|
---|
| 113 | <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec>
|
---|
[17413] | 114 | <!--<sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>-->
|
---|
[17381] | 115 | <delete file="imagemagick.lzma"/>
|
---|
| 116 | <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/windows"/>
|
---|
| 117 | <delete file="imagemagick.comp"/>
|
---|
| 118 | </target>
|
---|
| 119 |
|
---|
[17576] | 120 | <target name="Installing Ghostscript">
|
---|
[17381] | 121 | <echo message="Installing GhostScript"/>
|
---|
| 122 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
|
---|
| 123 | <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec>
|
---|
[17413] | 124 | <!--<sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>-->
|
---|
[17381] | 125 | <delete file="ghostscript.lzma"/>
|
---|
| 126 | <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/windows"/>
|
---|
| 127 | <delete file="ghostscript.comp"/>
|
---|
| 128 | </target>
|
---|
| 129 |
|
---|
[16633] | 130 | <!-- Start menu shortcuts -->
|
---|
[17576] | 131 | <target name="Installing Start Menu Shortcuts">
|
---|
[15023] | 132 |
|
---|
[16917] | 133 | <mkdir dir="${startmenu.path}\Documentation"/>
|
---|
| 134 |
|
---|
[16633] | 135 | <shortcut
|
---|
[18059] | 136 | file="${startmenu.path}\Greenstone Server.lnk"
|
---|
[16774] | 137 | execute="${installDir}\server.exe"
|
---|
[16633] | 138 | workingDirectory="${installDir}"
|
---|
[18047] | 139 | iconFile="${installDir}\images\serverico.ico"
|
---|
[16633] | 140 | iconIndex="0" />
|
---|
[17814] | 141 |
|
---|
[16633] | 142 | <shortcut
|
---|
[18047] | 143 | file="${startmenu.path}\Librarian Interface (GLI).lnk"
|
---|
[16633] | 144 | execute="${installDir}\gli\gli.bat"
|
---|
| 145 | workingDirectory="${installDir}\gli"
|
---|
| 146 | iconFile="${installDir}\images\icon.ico"
|
---|
| 147 | iconIndex="0" />
|
---|
[17814] | 148 |
|
---|
[16633] | 149 | <shortcut
|
---|
[18059] | 150 | file="${startmenu.path}\Metadata Set Editor (GEMS).lnk"
|
---|
[17381] | 151 | execute="${installDir}\gli\gems.bat"
|
---|
[16633] | 152 | workingDirectory="${installDir}\gli"
|
---|
[18047] | 153 | iconFile="${installDir}\images\gems.ico"
|
---|
[16633] | 154 | iconIndex="0" />
|
---|
[17814] | 155 |
|
---|
[16633] | 156 | <shortcut
|
---|
[17257] | 157 | file="${startmenu.path}\Uninstall.lnk"
|
---|
[17436] | 158 | execute="${installDir}\Uninstall.bat"
|
---|
[17257] | 159 | workingDirectory="${installDir}"
|
---|
[18047] | 160 | iconFile="${installDir}\images\uninstall.ico"
|
---|
[17257] | 161 | iconIndex="0" />
|
---|
[17814] | 162 |
|
---|
[17257] | 163 | <shortcut
|
---|
[16917] | 164 | file="${startmenu.path}\Documentation\READMEen.lnk"
|
---|
[16633] | 165 | execute="${installDir}\READMEen.txt" />
|
---|
[17814] | 166 |
|
---|
[16633] | 167 | <shortcut
|
---|
[18067] | 168 | file="${startmenu.path}\Documentation\Greenstone Wiki.url"
|
---|
| 169 | url="http://wiki.greenstone.org" />
|
---|
| 170 |
|
---|
| 171 | <shortcut
|
---|
| 172 | file="${startmenu.path}\Documentation\Greenstone Website.url"
|
---|
| 173 | url="http://www.greenstone.org" />
|
---|
| 174 |
|
---|
| 175 | <!--
|
---|
| 176 | <shortcut
|
---|
[16917] | 177 | file="${startmenu.path}\Documentation\READMEes.lnk"
|
---|
[16633] | 178 | execute="${installDir}\READMEes.txt" />
|
---|
[17814] | 179 |
|
---|
[16633] | 180 | <shortcut
|
---|
[16917] | 181 | file="${startmenu.path}\Documentation\READMEar.lnk"
|
---|
[16633] | 182 | execute="${installDir}\READMEar.txt" />
|
---|
[17814] | 183 |
|
---|
[16633] | 184 | <shortcut
|
---|
[16917] | 185 | file="${startmenu.path}\Documentation\READMEfr.lnk"
|
---|
[16633] | 186 | execute="${installDir}\READMEfr.txt" />
|
---|
[17814] | 187 |
|
---|
[16633] | 188 | <shortcut
|
---|
[16917] | 189 | file="${startmenu.path}\Documentation\READMEru.lnk"
|
---|
[16633] | 190 | execute="${installDir}\READMEru.txt" />
|
---|
[18067] | 191 | -->
|
---|
[17814] | 192 |
|
---|
[15023] | 193 | </target>
|
---|
[16633] | 194 |
|
---|
[17815] | 195 | <target name="Source Release" depends="">
|
---|
| 196 |
|
---|
| 197 | <!-- create the installation directory -->
|
---|
| 198 | <echo message="Creating Installation directory"/>
|
---|
| 199 | <mkdir dir="${installDir}"/>
|
---|
| 200 |
|
---|
| 201 | <!-- extract 7za tool -->
|
---|
| 202 | <unzip src="${antinstaller.jar}" dest="${basedir}">
|
---|
| 203 | <patternset><include name="7za.exe"/></patternset>
|
---|
| 204 | </unzip>
|
---|
| 205 |
|
---|
| 206 | <echo>Installing Source Release</echo>
|
---|
| 207 | <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="source-release.lzma"/></patternset></unzip>
|
---|
| 208 | <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x source-release.lzma"/></exec>
|
---|
| 209 | <delete file="source-release.lzma"/>
|
---|
| 210 | <unzip src="${basedir}/source-release.comp" dest="${installDir}"/>
|
---|
| 211 | <delete file="source-release.comp"/>
|
---|
| 212 |
|
---|
| 213 | <!-- figure out the start menu path -->
|
---|
| 214 | <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
|
---|
| 215 | <path id="startmenu.path.path" path="${startmenu.path}"/>
|
---|
| 216 | <pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
|
---|
| 217 |
|
---|
| 218 | <echo message="Filling in concrete values in config files"/>
|
---|
| 219 | <rsr file="${installDir}/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
| 220 | <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
|
---|
| 221 | <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
|
---|
| 222 | <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
|
---|
| 223 | <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
|
---|
| 224 | </rsr>
|
---|
| 225 |
|
---|
| 226 | <echo>Create usage.txt</echo>
|
---|
| 227 | <echo file="${installDir}/etc/usage.txt"></echo>
|
---|
| 228 |
|
---|
| 229 | <echo message="Creating installation properties file"/>
|
---|
| 230 | <echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
|
---|
| 231 |
|
---|
| 232 | <echo message="Finished"/>
|
---|
| 233 |
|
---|
| 234 | </target>
|
---|
| 235 |
|
---|
| 236 |
|
---|
[15023] | 237 | </project>
|
---|