<?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 -->
	<!-- We want a dropdown for installer language selection.
	<select> is rendered as radio buttons in the GUI version.
	antinstaller.sourceforge.net/manual.html
	<large-select>: "The large select has identical options to the select input. 
	Large select enables the list of options to be greater and is displayed differently. 
	In the Swing GUI the options are rendered as a drop-down list. 
	In the text/console UI the options are shown to the user 20 lines at a time."
	An example: https://github.com/ykyuen/maven-h2o/blob/master/h2o-installer/ant-installer/antinstall-config.xml
	
	However, to get <large-select> to work as <select> did, needed to modify the AntInstaller code itself
	in release-kits\shared\core\ant-installer\src\org\tp23\antinstaller\runtime\exe\LoadConfigFilter.java,
	and also bring the code in antinstaller\input\LargeSelectInput.java up to speed with Oran's changes to <select> 
	in ant-installer\src\org\tp23\antinstaller\input\SelectInput.java
	
	<option value="hy" text="Armenian"/>
	<option value="jp" text="日本語 (Japanese)"/>
	-->
	<page type="input" name="language-selector" displayText="">
		<comment name="language-selector-explanation"/>
		<large-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"/>
			<option value="gu" text="ગુજરાતી (Gujarati)"/>
			<option value="ja" text="日本語 (Japanese)"/>
			<option value="kk" text="Қазақ (Kazakh)"/>
			<option value="pl" text="Polski (Polish)"/>
			<option value="ka" text="Georgian"/>
			<option value="hy" text="Armenian"/>
			<option value="it" text="Italiano (Italian)"/>
		</large-select>
	</page>

	<!-- welcome page -->
	<page type="input" name="intro" displayText="">
		<comment name="welcome-greenstone3"/>
	</page>

	<!--  type="license" shows a license page to click through -->
	<page type="license" name="license" resource="/LICENSE.txt"  displayText="" />

	<!--  install destination page -->
	<page type="input" name="destination" displayText="">

		<!-- NO FLAX START -->

		<!-- if linux|mac -->
		<directory property="installDir"
			defaultValue="/usr/local/Greenstone3,${env.HOME}/Greenstone3"
			create="true"
			displayText=""
			flagFile="_uninst"
			flagFileExistsProperty="ISInstallDetected"
			/>
		<!-- /if -->
		<!-- if windows -->
		<directory property="installDir"
			defaultValue="C:\Program Files\Greenstone3,${env.HOMEDRIVE}${env.HOMEPATH}\Greenstone3"
			create="true"
			displayText=""
			flagFile="_uninst"
			flagFileExistsProperty="ISInstallDetected"
			/>
		<!-- /if -->

		<!-- NO FLAX END -->

		<!-- FLAX START -->
	
		<!-- if linux|mac -->
		<directory property="installDir"
			defaultValue="/usr/local/FLAX,${env.HOME}/FLAX"
			create="true"
			displayText=""
			flagFile="_uninst"
			flagFileExistsProperty="ISInstallDetected"
			/>
		<!-- /if -->
		<!-- if windows -->
		<directory property="installDir"
			defaultValue="C:\Program Files\FLAX,${env.HOMEDRIVE}${env.HOMEPATH}\FLAX"
			create="true"
			displayText=""
			flagFile="_uninst"
			flagFileExistsProperty="ISInstallDetected"
			/>
		<!-- /if -->
		
		<!-- FLAX END -->

	</page>

	<!-- page to stop you going forward if an IS installation is detected -->
	<page type="input" name="dontBudge" displayText="" ifProperty="(${ISInstallDetected}==true)" showNextButton="false">
		<comment name="is-install-detected"/>
	</page>

	<!-- page to choose components -->
	<page type="input" name="selector" displayText="">
		<comment name="choose-components"/>

		<target
			target="Initialising"
			diskRequirement="x"
			defaultValue="true"
			displayText="x"
			force="true"
			hidden="true"/>

		<target
			target="Installing Core System"
			diskRequirement="@component.size.core@"
			displayText=""
			defaultValue="true"
			force="true"/>

		<!-- NO FLAX START -->

		<target
			target="Adjusting Permissions"
			diskRequirement="x"
			defaultValue="true"
			displayText="x"
			hidden="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 -->

		<target
			target="Installing Tomcat"
			diskRequirement="@component.size.tomcat@"
			defaultValue="true"
			displayText=""/>

		<!-- start amp -->
		<target
		   target="Installing AMP"
		   diskRequirement="@component.size.amp@"
		   defaultValue="true"
		   displayText=""/>
		<!-- end amp -->

		<!-- if windows -->
		<target
			target="Installing Start Menu Shortcuts"
			diskRequirement="~10 KB"
			defaultValue="true"
			displayText=""/>
		<!-- /if -->

		<!-- NO FLAX END -->

		<!-- FLAX START -->

		<target
			target="Installing ImageMagick"
			diskRequirement="@component.size.imagemagick@"
			defaultValue="true" 
			displayText=""
			force="true"/>

		<target
			target="Installing Tomcat"
			diskRequirement="@component.size.tomcat@"
			defaultValue="true"
			displayText=""
			force="true"/>

		<!-- if windows -->
		<target
			target="Installing Start Menu Shortcuts"
			diskRequirement="~10 KB"
			defaultValue="true"
			displayText=""
			force="true"/>
		<!-- /if -->
		
		<!-- FLAX END -->

	</page>

	<!-- page to setup tomcat -->
	<!--<page type="input" name="tomcat-config" ifProperty="(${Installing Tomcat}==true)" displayText="">
		<text property="tomcat.server" defaultValue="localhost" displayText=""/>
		<text property="tomcat.port" defaultValue="8383" displayText=""/>
		<text property="tomcat.shutdown.port" defaultValue="8305" displayText=""/>
	</page>-->

  <!-- NO FLAX START -->
	
	<!-- page to ask if we should enable admin pages -->
	<page type="input" name="admin-pages" displayText="">
		<comment name="admin3-expl"/>
		<comment name="admin3-expl-2"/>
		<comment name="admin3-expl-3"/>
		<checkbox property="set.admin.pwd" displayText="" defaultValue="false"/>
	</page>

	<!-- only if they said yes above, set a password -->
	<page type="input" name="admin-password" displayText="" ifProperty="(${set.admin.pwd}==true)" target="Configuring Administration Pages">
		<comment name="admin-password-expl"/>
		<validated property="admin.password" defaultValue="" displayText="" regex="^.{3,20}$"/>
	</page>
  <!-- NO FLAX END -->

	<!-- the final progress page -->
	<page type="progress" name="progress" showTargets="true" displayText=""/>

</installer>
