source: release-kits/wirk2/installer/build.xml@ 17381

Last change on this file since 17381 was 17381, checked in by oranfry, 16 years ago

new logic for installing components which are now individually compressed

File size: 7.1 KB
RevLine 
[15023]1<?xml version="1.0"?>
2<!--
3This 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"/>
[15023]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
31 <target name="load-previous-props" if="is.overinstall">
32 <property file="${installDir}\etc\installation.properties"/>
33 </target>
[16087]34
[16931]35 <target name="install-core-components" depends="load-previous-props">
[16087]36
[17125]37 <!-- figure out the start menu path (if not already set from previous installation) -->
38 <getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>
39
[15023]40 <echo>basedir: ${basedir}</echo>
41 <echo>installDir: ${installDir}</echo>
42 <echo>antinstaller.jar: ${antinstaller.jar}</echo>
[17125]43 <echo>startmenu.path: ${startmenu.path}</echo>
[16087]44
45 <!-- create the installation directory -->
46 <echo message="Creating Installation directory"/>
[15023]47 <mkdir dir="${installDir}"/>
[16747]48
[17381]49 <!-- extract 7za tool -->
50 <unzip src="${antinstaller.jar}" dest="${basedir}">
51 <patternset><include name="7za.exe"/></patternset>
[15023]52 </unzip>
[16633]53
[17381]54 <!-- install files -->
55 <echo message="Installing Core Component"/>
56 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
57 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x core.lzma"/></exec>
58 <delete file="core.lzma"/>
59 <unzip src="${basedir}/core.comp" dest="${installDir}"/>
60 <delete file="core.comp"/>
61
[17107]62 <echo message="Creating admin and demo users"/>
[17311]63 <adduser
64 txt2db="${installDir}/bin/windows/txt2db"
[17107]65 usersDb="${installDir}/etc/users.db"
66 username="admin"
67 password="${admin.password}"
68 groups="administrator,colbuilder"
69 comment="created at install time"/>
70 <adduser
[17119]71 txt2db="${installDir}/bin/windows/txt2db"
[17107]72 usersDb="${installDir}/etc/users.db"
73 username="demo"
74 password="demo"
75 groups="demo"
76 comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
77
[15023]78 <!-- delete unneeded files -->
[16774]79 <echo message="Deleting some unneeded files"/>
[15023]80 <delete dir="${installDir}/resources/icons"/>
81 <delete file="${installDir}/resources/*.png"/>
[16774]82
[17074]83 <echo message="Filling in concrete values in config files"/>
[17311]84 <rsr file="${installDir}/setup.bat" pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
85 <rsr file="${installDir}/cgi-bin/gsdlsite.cfg">
86 <job pattern="\*\*GSDLHOME\*\*" replacement="${installDir}"/>
87 <job pattern="^(#?httpprefix).*" replacement="$1 /gsdl"/>
88 <job pattern="^(#?httpimg).*" replacement="$1 /gsdl/images"/>
89 </rsr>
[17080]90 <rsr file="${installDir}/gsdlsite.cfg" pattern="@gsdlhome@" replacement="${installDir}"/>
91
[16948]92 <echo message="Creating installation properties file"/>
[17125]93 <echo file="${installDir}\etc\installation.properties">startmenu.path:${startmenu.path}</echo>
94
[16087]95 <echo message="Finished"/>
[16633]96
[15023]97 </target>
98
99 <!-- Source -->
[16087]100 <target name="install-source-code" depends="">
[16817]101 <echo message="Installing Source Code"/>
[17381]102 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="sourcecode.lzma"/></patternset></unzip>
103 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x sourcecode.lzma"/></exec>
104 <delete file="sourcecode.lzma"/>
105 <unzip src="${basedir}/sourcecode.comp" dest="${installDir}"/>
106 <delete file="sourcecode.comp"/>
[15023]107 </target>
[17311]108
[17381]109 <target name="install-windows-jre">
110 <echo>Installing Java Runtime Environment</echo>
[17311]111 <mkdir dir="${installDir}/packages"/>
112 <copy todir="${installDir}/packages/jre">
[17381]113 <fileset dir="../@windows-java.extracted@"/>
[17311]114 </copy>
115 </target>
[16633]116
[17381]117 <target name="install-imagemagick">
118 <echo message="Installing ImageMagick"/>
119 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
120 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x imagemagick.lzma"/></exec>
121 <delete file="imagemagick.lzma"/>
122 <unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/windows"/>
123 <delete file="imagemagick.comp"/>
124 </target>
125
126 <target name="install-ghostscript">
127 <echo message="Installing GhostScript"/>
128 <unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
129 <exec dir="${basedir}" executable="${basedir}/7za.exe"><arg line="x ghostscript.lzma"/></exec>
130 <delete file="ghostscript.lzma"/>
131 <unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/windows"/>
132 <delete file="ghostscript.comp"/>
133 </target>
134
[16633]135 <!-- Start menu shortcuts -->
136 <target name="install-start-menu-shortcuts">
[15023]137
[16917]138 <mkdir dir="${startmenu.path}\Documentation"/>
139
[16633]140 <shortcut
[16917]141 file="${startmenu.path}\Greenstone2 Server.lnk"
[16774]142 execute="${installDir}\server.exe"
[16633]143 workingDirectory="${installDir}"
144 iconFile="${installDir}\images\icon.ico"
145 iconIndex="0" />
146 <shortcut
[16917]147 file="${startmenu.path}\Greenstone Librarian Interface (GLI).lnk"
[16633]148 execute="${installDir}\gli\gli.bat"
149 workingDirectory="${installDir}\gli"
150 iconFile="${installDir}\images\icon.ico"
151 iconIndex="0" />
152 <shortcut
[16917]153 file="${startmenu.path}\Greenstone Editor for Metadata Sets (GEMS).lnk"
[17381]154 execute="${installDir}\gli\gems.bat"
[16633]155 workingDirectory="${installDir}\gli"
156 iconFile="${installDir}\images\icon.ico"
157 iconIndex="0" />
158 <shortcut
[17257]159 file="${startmenu.path}\Uninstall.lnk"
[17311]160 execute="${installDir}\bin\windows\search4j.exe -h packages\jre -l Uninstall.jar"
[17257]161 workingDirectory="${installDir}"
162 iconFile="${installDir}\images\icon.ico"
163 iconIndex="0" />
164 <shortcut
[16917]165 file="${startmenu.path}\Documentation\READMEen.lnk"
[16633]166 execute="${installDir}\READMEen.txt" />
167 <shortcut
[16917]168 file="${startmenu.path}\Documentation\READMEes.lnk"
[16633]169 execute="${installDir}\READMEes.txt" />
170 <shortcut
[16917]171 file="${startmenu.path}\Documentation\READMEar.lnk"
[16633]172 execute="${installDir}\READMEar.txt" />
173 <shortcut
[16917]174 file="${startmenu.path}\Documentation\READMEfr.lnk"
[16633]175 execute="${installDir}\READMEfr.txt" />
176 <shortcut
[16917]177 file="${startmenu.path}\Documentation\READMEru.lnk"
[16633]178 execute="${installDir}\READMEru.txt" />
[15023]179 </target>
[16633]180
181 <target name="cleanuptarget"></target>
[15023]182
183
184</project>
Note: See TracBrowser for help on using the repository browser.