Index: /release-kits/lirk2/ant-scripts/create-installer.xml
===================================================================
--- /release-kits/lirk2/ant-scripts/create-installer.xml	(revision 20041)
+++ /release-kits/lirk2/ant-scripts/create-installer.xml	(revision 20042)
@@ -8,5 +8,5 @@
 	</target>
 
-	<target name="copy-installer-files" depends="copy-main-installer-files"> <!-- from init -->
+	<target name="copy-installer-files" depends="copy-main-installer-files,copy-greenstone2-installer-files"> <!-- from init -->
 
 		<copy todir="${basedir}/installer/classes" overwrite="true">
Index: /release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml
===================================================================
--- /release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml	(revision 20041)
+++ /release-kits/shared/greenstone2/ant-scripts/rk2-targets.xml	(revision 20042)
@@ -244,4 +244,12 @@
 	</target>
 
+	<target name="copy-greenstone2-installer-files">
+
+		<!-- the installer descriptors -->
+		<copy todir="installer" file="${rk.home}/greenstone2/installer/antinstall-config.xml" overwrite="true"/>
+		<copy todir="installer" file="${rk.home}/greenstone2/installer/build.xml" overwrite="true"/>
+
+	</target>
+
 </project>
 	
Index: /release-kits/shared/greenstone2/installer/antinstall-config.xml
===================================================================
--- /release-kits/shared/greenstone2/installer/antinstall-config.xml	(revision 20042)
+++ /release-kits/shared/greenstone2/installer/antinstall-config.xml	(revision 20042)
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE installer PUBLIC "-//tp23 //DTD Ant Installer Config//EN" "http://antinstaller.sf.net/dtd/antinstall-config-0.8.dtd">
+<installer
+			ui="swing,text"
+			verbose="true"
+			debug="false"
+			lookAndFeel="org.tp23.jgoodies.plaf.plastic.PlasticXPLookAndFeel"
+			name="Greenstone@version@ Installer"
+			windowIcon="/resources/icon.png"
+			defaultImageResource="/resources/header.png"
+			minJavaVersion="1.4">
+
+	<!-- select language page -->
+	<page type="input" name="language-selector" displayText="">
+		<comment name="language-selector-explanation"/>
+		<select property="language" defaultValue="en" displayText="" useAsLocale="true">
+			<option value="en" text="English"/>
+			<option value="fr" text="FranÃ§ais (French)"/>
+			<option value="es" text="EspaÃ±ol (Spanish)"/>
+			<option value="de" text="Deutsch (German)"/>
+			<option value="ru" text="ÑÑÑÑÐºÐžÐ¹ ÑÐ·ÑÐº (Russian)"/>
+			<option value="zh" text="äž­æ (Chinese)"/>
+			<option value="ar" text="Arabic"/>
+		</select>
+	</page>
+
+	<!-- intro page -->
+	<page type="input" name="intro" displayText="">
+		<comment name="welcome"/>
+	</page>
+
+	<!-- licence page -->
+	<page type="license" name="license" resource="/LICENSE.txt"  displayText="" />
+
+	<!--  install destination page -->
+	<page type="input" name="destination" displayText="">
+
+		<!-- if linux|mac -->
+		<directory property="installDir"
+			defaultValue="/usr/local/Greenstone,${env.HOME}/Greenstone"
+			create="true"
+			displayText=""
+			flagFile="_uninst"
+			flagFileExistsProperty="ISInstallDetected"
+			/>
+		<!-- /if -->
+		<!-- if windows -->
+		<directory property="installDir"
+			defaultValue="C:\Program Files\Greenstone,${env.HOMEDRIVE}\${env.HOMEPATH}\Greenstone"
+			create="true"
+			displayText=""
+			flagFile="_uninst"
+			flagFileExistsProperty="ISInstallDetected"
+			/>
+		<!-- /if -->
+
+	</page>
+
+	<!-- don't budge if installshield installation found -->
+	<page type="input" name="dontBudge" displayText="" ifProperty="(${ISInstallDetected}==true)" showNextButton="false">
+		<comment name="is-install-detected"/>
+	</page>
+
+	<!-- conmponents -->
+	<page type="input" name="selector" displayText="">
+		<comment name="choose-components"/>
+
+		<!-- if linux|windows -->
+		<target
+			target="Initialising"
+			diskRequirement="x"
+			defaultValue="true"
+			displayText="x"
+			force="true"
+			hidden="true"/>
+		<!-- /if -->
+
+		<target
+			target="Installing Core System"
+			diskRequirement="@component.size.core@"
+			displayText=""
+			defaultValue="true"
+			force="true"/>
+
+		<target
+			target="Installing ImageMagick"
+			diskRequirement="@component.size.imagemagick@"
+			defaultValue="true" 
+			displayText=""/>
+
+		<!-- if windows|mac -->
+		<target
+			target="Installing Ghostscript"
+			diskRequirement="@component.size.ghostscript@"
+			defaultValue="true" 
+			displayText=""/>
+		<!-- /if -->
+
+
+		<!-- start cdrom -->
+		<!-- the size of this component has to be maintained manually as we can't
+			know at compile time how big the documented examples are -->
+		<target
+			target="Installing Documented Examples"
+			diskRequirement="108 MB"
+			defaultValue="true" 
+			displayText=""/>
+		<!-- end cdrom -->
+
+		<!-- if windows -->
+		<target
+			target="Installing Start Menu Shortcuts"
+			diskRequirement="~10 KB"
+			defaultValue="true"
+			displayText=""/>
+		<!-- /if -->
+
+	</page>
+
+	<!-- page to ask if we should enable admin pages -->
+	<page type="input" name="admin-pages" displayText="">
+		<comment name="admin-expl"/>
+		<comment name="admin-expl-2"/>
+		<comment name="admin-expl-3"/>
+		<checkbox property="enable.admin.pages" displayText="" defaultValue="false"/>
+	</page>
+
+	<!-- if they said yes above, set a password -->
+	<page type="input" name="admin-password" displayText="" ifProperty="(${enable.admin.pages}==true)" target="Configuring Administration Pages">
+		<comment name="admin-password-expl"/>
+		<validated property="admin.password" defaultValue="" displayText="" regex="^.{3,20}$"/>
+	</page>
+
+	<!-- progress page -->
+	<page type="progress" name="progress" showTargets="true" displayText=""/>
+
+</installer>
Index: /release-kits/shared/greenstone2/installer/build.xml
===================================================================
--- /release-kits/shared/greenstone2/installer/build.xml	(revision 20042)
+++ /release-kits/shared/greenstone2/installer/build.xml	(revision 20042)
@@ -0,0 +1,290 @@
+<?xml version="1.0"?>
+<!--
+This is the build.xml run by AntInstaller for the installer
+-->
+
+<project name="Installation">
+
+	<!-- this is required to pick up the properties generated during the install pages -->
+	<property file="${basedir}/ant.install.properties"/>
+
+	<!-- set some properties to keep track of the OS -->
+	<!-- if windows -->
+	<property name="rk.os" value="windows"/>
+	<property name="shell.name" value="windows"/>
+	<!-- /if -->
+	<!-- if linux -->
+	<property name="rk.os" value="linux"/>
+	<property name="shell.name" value="linux"/>
+	<!-- /if -->
+	<!-- if mac -->
+	<property name="rk.os" value="mac"/>
+	<property name="shell.name" value="darwin"/>
+	<!-- /if -->
+
+	<!-- classpath -->
+	<path id="project.classpath">
+		<pathelement path="${antinstaller.jar}"/>
+	</path>
+
+	<!-- custom tasks -->
+	<typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/>
+	<typedef name="adduser" classname="org.greenstone.anttasks.AddGreenstoneUserToDatabase" classpathref="project.classpath"/>
+	<!-- if windows -->
+	<taskdef name="shortcut" classname="com.orangevolt.tools.ant.Win32ShortcutTask" classpathref="project.classpath"/>
+	<taskdef name="winprops" classname="com.orangevolt.tools.ant.Win32PropertiesTask" classpathref="project.classpath"/> 
+	<typedef name="getfreepath" classname="org.greenstone.anttasks.GetFreePath" classpathref="project.classpath"/>
+	<taskdef name="sevenzip" classname="org.greenstone.anttasks.WindowsSevenZipWrapper" classpathref="project.classpath"/>
+	<!-- /if -->
+	<!-- if linux|mac -->
+	<taskdef name="sevenzip" classname="org.apache.tools.ant.SevenZip" classpathref="project.classpath"/>
+	<!-- /if -->
+	
+	<!-- determine if a bundled java exists -->
+	<condition property="bundled.java.exists">
+		<available file="../@linux-java.extracted@/bin/java"/>
+	</condition>
+
+	<!-- determine if there is an existing installation in the installDir-->
+	<available file="${installDir}\etc\installation.properties" property="is.overinstall"/>
+
+	<!-- create a local installDir String -->
+	<path id="installDir.path"><pathelement location="${installDir}"/></path>
+	<property name="installDir.local" refid="installDir.path"/>
+
+	<!-- if windows -->
+	<!-- load windows properties -->
+	<winprops/>
+	<!-- /if -->
+
+	<!-- load the properties of the previous installation if this is an overinstall -->
+	<target name="Looking For Previous Installation" if="is.overinstall">
+		<property file="${installDir}\etc\installation.properties"/>
+		<delete dir="${installed.startmenu.path}" failonerror="false"/>
+	</target>
+
+	<!-- copy jre -->
+	<target name="Initialising" if="bundled.java.exists">
+		<mkdir dir="${installDir}/packages"/>
+		<copy todir="${installDir}/packages/jre" failonerror="false">
+			<fileset dir="../@linux-java.extracted@"/>
+		</copy>
+		<chmod dir="${installDir}/packages/jre/bin" includes="*" perm="775"/>		
+	</target>
+
+	<!-- core system -->
+	<target name="Installing Core System">
+
+		<!-- if windows -->
+		<!-- figure out the start menu path -->
+		<getfreepath path="${win32.personal.programs_menu}\Greenstone-@version@" property="startmenu.path"/>		
+		<path id="startmenu.path.path" path="${startmenu.path}"/>
+		<pathconvert targetos="unix" property="startmenu.path.unix" refid="startmenu.path.path"/>
+
+		<!-- extract 7za tool -->
+		<unzip src="${antinstaller.jar}" dest="${basedir}">
+			<patternset><include name="7za.exe"/></patternset>
+		</unzip>
+		<!-- /if -->
+
+		<!-- start web -->
+		<unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="core.lzma"/></patternset></unzip>
+		<sevenzip task="decode" input="${basedir}/core.lzma" output="${basedir}/core.comp"/>
+		<delete file="core.lzma"/>
+		<unzip src="${basedir}/core.comp" dest="${installDir}"/>
+		<delete file="core.comp"/>
+		<!-- end web -->
+
+		<!-- start cdrom -->
+		<copy todir="${installDir}">
+			<fileset dir="${orig.dir}/Software/core/all"/>
+			<fileset dir="${orig.dir}/Software/core/${rk.os}"/><!-- /if -->
+		</copy>
+		<!-- if windows -->
+		<copy todir="${installDir}/packages/jre" failonerror="false">
+			<fileset dir="${orig.dir}/Java/Windows/jre"/>
+		</copy>
+		<!-- /if -->
+		<!-- end cdrom -->
+
+		<echo>Setting Binaries to Executable</echo>
+		<chmod dir="${installDir}" includes="*.sh,*.bash" perm="775"/>
+		<chmod dir="${installDir}/bin" includes="*" perm="775"/>
+		<chmod dir="${installDir}/cgi-bin" includes="*" perm="775"/>
+		<chmod dir="${installDir}/bin/script" includes="**/*" perm="775"/>
+		<chmod dir="${installDir}/gli" includes="*.sh" perm="775"/>
+		<!-- if linux|mac -->
+		<chmod dir="${installDir}/bin/${shell.name}" includes="**/*" perm="775"/>
+		<chmod dir="${installDir}/apache-httpd/${shell.name}/bin" includes="*" perm="775"/>
+		<chmod dir="${installDir}/apache-httpd/${shell.name}" includes="*.sh" perm="775"/>
+		<!-- /if -->
+
+		<echo>Filling in concrete values in config files</echo>
+		<copy file="${installDir}/cgi-bin/gsdlsite.cfg.in" tofile="${installDir}/cgi-bin/gsdlsite.cfg"/>
+		<rsr file="${installDir}/cgi-bin/gsdlsite.cfg" pattern="\*\*GSDLHOME\*\*" replacement="${installDir.local}"/>
+
+		<echo>Correcting perl shebangs in perl scripts</echo>
+		<!-- if linux|mac -->
+		<exec executable="which" outputproperty="perl.executable"><arg value="perl"/></exec>
+		<rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
+		<!-- / if -->
+		<!-- if windows -->
+		<property name="perl.executable" value="${installDir.local}\bin\windows\perl\perl.exe"/>
+		<rsr file="${installDir}/cgi-bin/gliserver.pl" pattern="^#!.*" replacement="#!${perl.executable} -w" lines="1"/>
+		<!-- /if -->
+
+		<echo>Creating the english dictionary</echo>
+		<copy file="${installDir}/gli/classes/dictionary.properties" tofile="${installDir}/gli/classes/dictionary_en.properties"/>
+
+		<!-- if linux|mac -->
+		<echo>Set the installation locale in config files</echo>
+		<rsr file="${installDir}/setup.bash" pattern="^gsdllang=.*" replacement="gsdllang=${language}"/>
+		<rsr file="${installDir}/gli/gli.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
+		<rsr file="${installDir}/gli/gems.sh" pattern="^glilang=.*" replacement="glilang=${language}"/>
+		<!-- /if -->
+		<rsr
+			file="${installDir}/gli/classes/xml/config.xml"
+			pattern="(&lt;Argument name=&quot;general.locale&quot;&gt;).*(&lt;/Argument&gt;)"
+			replacement="$1${language}$2"/>
+
+		<echo file="${installDir}/etc/main.cfg" append="true"
+			>cgiarg          shortname=l argdefault=${language}</echo>
+
+		<!-- if linux|mac -->
+		<echo>Setting up apache web server</echo>
+		<exec dir="${installDir}" executable="${installDir}/apache-httpd/linux/install-bindist.sh">
+			<arg value="${installDir}/apache-httpd/${shell.name}"/>
+		</exec>
+		<!-- /if -->
+
+		<echo message="Creating installation properties file"/>
+		<!-- if linux|mac -->
+		<echo file="${installDir}/etc/installation.properties">#this file is just a placeholder for now</echo>
+		<!-- /if -->
+		<!-- if windows -->
+		<echo file="${installDir}\etc\installation.properties">installed.startmenu.path:${startmenu.path.unix}</echo>
+		<!-- /if -->
+		
+	</target>
+
+	<!-- ImageMagick -->
+	<target name="Installing ImageMagick">
+		<echo>Installing ImageMagick</echo>
+		<!-- start web -->
+		<unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="imagemagick.lzma"/></patternset></unzip>
+		<sevenzip task="decode" input="${basedir}/imagemagick.lzma" output="${basedir}/imagemagick.comp"/>
+		<delete file="imagemagick.lzma"/>
+		<unzip src="${basedir}/imagemagick.comp" dest="${installDir}/bin/${shell.name}"/>
+		<delete file="imagemagick.comp"/>
+		<!-- end web -->
+
+		<!-- start cdrom -->
+		<copy todir="${installDir}/bin/${shell.name}">
+			<fileset dir="${orig.dir}/Software/imagemagick/${rk.os}"/>
+		</copy>
+		<!-- end cdrom -->
+
+		<chmod dir="${installDir}/bin/${shell.name}/imagemagick/bin" includes="*" perm="775"/>
+		
+	</target>
+
+	<!-- Ghostscript -->
+	<target name="Installing Ghostscript" depends="">
+		<echo message="Installing Ghostscript"/>
+		<!-- start web -->
+		<unzip src="${antinstaller.jar}" dest="${basedir}"><patternset><include name="ghostscript.lzma"/></patternset></unzip>
+		<sevenzip task="decode" input="${basedir}/ghostscript.lzma" output="${basedir}/ghostscript.comp"/>
+		<delete file="ghostscript.lzma"/>
+		<unzip src="${basedir}/ghostscript.comp" dest="${installDir}/bin/${shell.name}" />
+		<delete file="ghostscript.comp"/>
+		<!-- end web -->
+
+		<!-- start cdrom -->
+		<copy todir="${installDir}/bin/${shell.name}">
+			<fileset dir="${orig.dir}/Software/ghostscript/${rk.os}"/>
+		</copy>
+		<!-- end cdrom -->
+
+		<chmod dir="${installDir}/bin/${shell.name}/ghostscript/bin" includes="*" perm="775"/>
+	</target>
+
+	<!-- Start menu shortcuts -->
+	<target name="Installing Start Menu Shortcuts">
+
+		<mkdir dir="${startmenu.path}\Documentation"/>
+		
+		<shortcut
+			file="${startmenu.path}\Greenstone Server.lnk"
+			execute="${installDir}\server.exe"
+			workingDirectory="${installDir}"
+			iconFile="${installDir}\web\images\serverico.ico"
+			iconIndex="0" />
+
+		<shortcut
+			file="${startmenu.path}\Librarian Interface (GLI).lnk"
+			execute="${installDir}\gli\gli.bat"
+			workingDirectory="${installDir}\gli"
+			iconFile="${installDir}\web\images\icon.ico"
+			iconIndex="0" />
+
+		<shortcut
+			file="${startmenu.path}\Librarian Interface for Remote Server (Client GLI).lnk"
+			execute="${installDir}\gli\client-gli.bat"
+			workingDirectory="${installDir}\gli"
+			iconFile="${installDir}\web\images\icon.ico"
+			iconIndex="0" />
+
+		<shortcut
+			file="${startmenu.path}\Metadata Set Editor (GEMS).lnk"
+			execute="${installDir}\gli\gems.bat"
+			workingDirectory="${installDir}\gli"
+			iconFile="${installDir}\web\images\gems.ico"
+			iconIndex="0" />
+
+		<shortcut
+			file="${startmenu.path}\Uninstall.lnk"
+			execute="${installDir}\Uninstall.bat"
+			workingDirectory="${installDir}"
+			iconFile="${installDir}\web\images\uninstall.ico"
+			iconIndex="0" />
+
+		<shortcut
+			file="${startmenu.path}\Documentation\READMEen.lnk"
+			execute="${installDir}\READMEen.txt" />
+
+		<shortcut
+			file="${startmenu.path}\Documentation\Greenstone Wiki.url"
+			url="http://wiki.greenstone.org" />
+
+		<shortcut
+			file="${startmenu.path}\Documentation\Greenstone Website.url"
+			url="http://www.greenstone.org" />
+			
+	</target>
+
+	<target name="Configuring Administration Pages" if="enable.admin.pages">
+		<echo>Enabling Admin Pages</echo>
+		<rsr file="${installDir}/etc/main.cfg" pattern="^\s*status\s+.*" replacement="status enabled"/>
+		<echo>Creating admin and demo users</echo>
+		<adduser txt2db="${installDir}/bin/${shell.name}/txt2db"
+			usersDb="${installDir}/etc/users.gdb"
+			username="admin"
+			password="${admin.password}"
+			groups="administrator,colbuilder,all-collections-editor"
+			comment="created at install time"/>
+		<adduser
+			txt2db="${installDir}/bin/${shell.name}/txt2db"
+			usersDb="${installDir}/etc/users.gdb"
+			username="demo"
+			password="demo"
+			groups="demo"
+			comment="Dummy 'demo' user with password 'demo' for authen-e collection"/>
+	</target>
+
+	<target name="Installing Documented Examples">
+		<copy todir="${installDir}/collect">
+			<fileset dir="${orig.dir}/Documented Examples" includes="documented-examples/**/*"/>
+		</copy>
+	</target>
+
+</project>
