<?xml version="1.0"?>
<!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="true"
        lookAndFeel="native"
        name="Aperi Storage Manager Installer"
        windowIcon="/resources/splash.png"
        defaultImageResource="/resources/uppersplash.png"
        minJavaVersion="1.5"
        antialiased="true"
        finishButtonText="Install"
        version="5.3"
        wide="600:275">
    <page
        type="splash"
        name="splash"
        displayText="Aperi Storage Manager Installer"
        splashResource="/resources/splash.png"
        altText="--(o--Aperi Storage Manager Installer--o)--" 
        target="init">
    </page>
    <page
        type="license"
        name="license"
        displayText="License conditions"
        resource="/resources/EPL.txt"
        usePaging="true" />
    <page
        type="input"
        name="componentSelection"
        displayText="Component Selection">
        <comment
        	displayText="The Aperi Storage Manager consists of three major components: The server, the host-based agent, and the GUI."
				title="false" />
        <comment
        	displayText="You can configure any or all of these to run on this computer."
				title="false" />
		<target-select defaultValue="configureDerby" property="db.target" displayText="Database">
			<option value="configureDerby" text="Derby"/>
			<option value="configureDB2" text="DB2"/>
			<option value="noDB" text="No Database"/>
		</target-select>
        <target
        	target="configureServer"
        	displayText="Server"
        	defaultValue="true"
        	osSpecific="true"
        	strict="false" />
        <target
        	target="configureAgent"
        	displayText="Agent"
        	defaultValue="true"
        	osSpecific="true"
        	strict="false" />
        <target
        	target="download"
        	displayText="Download 3rd Party Components"
        	defaultValue="true"
        	osSpecific="false" />
        <target
        	target="postInstall"
        	displayText="Core Components"
        	defaultValue="true"
        	force="true" />
    </page>
	<page
		type="input"
		name="agentConfig"
		displayText="Agent configuration"
		ifProperty="${configureAgent}==true">
		<comment
			displayText="Enter values to configure the agent."
			title="true" />
		<ext-validated
			property="agent.port"
			displayText="Agent port"
			defaultValue="9570"
			validationClass="org.eclipse.aperi.install.ValidatePort" />
		<hidden
			property="agent.heap"
			value="256m"
		/>
	</page>
	<page 
		name="serverConfig"
		displayText="Server configuration"
		type="input"
		ifProperty="(${configureAgent}==true)OR(${configureServer}==true)">
		<comment
			displayText="Enter values to configure the server."
			title="true" />
		<validated
			property="server.hostname"
			displayText="Server hostname"
			defaultValue="localhost"
			regex="[a-zA-Z0-9.]*"
		/>
		<ext-validated
			property="server.data.port"
			displayText="Data server port"
			defaultValue="9549"
			validationClass="org.eclipse.aperi.install.ValidatePort"
		/>
		<ext-validated
			property="server.device.port"
			displayText="Device server port"
			defaultValue="9000"
			validationClass="org.eclipse.aperi.install.ValidatePort"
		/>
		<validated
			property="server.data.adminGroup"
			displayText="Administrative group"
			defaultValue="Administrators"
			regex="[a-zA-Z0-9]*"
		/>
		<hidden
			property="server.reporting.port"
			value="8080"
		/>
		<directory
			property="server.reporting.dir"
			defaultValue="${user.dir}/../reporting/reports"
			checkExists="true"
			create="true"
			displayText="Report server repository path"
			defaultValueWin="${user.dir}/../reporting/reports"
		/>
		<hidden
			property="server.data.heap"
			value="1024m"
		/>
		<hidden
			property="server.device.heap"
			value="1024m"
		/>
	</page>
	<page
		name="derbyConfiguration"
		displayText="Derby Configuration"
		type="input"
		ifProperty="${db.target}==configureDerby">
		<validated
			property="db.hostname"
			displayText="Database hostname"
			defaultValue="localhost"
			regex="[a-zA-Z0-9.]*"
		/>
		<ext-validated
			property="db.port"
			displayText="Database port"
			defaultValue="1527"
			validationClass="org.eclipse.aperi.install.ValidatePort"
		/>
		<hidden
			property="db.driver"
			defaultValue="org.apache.derby.jdbc.ClientDriver"
		/>
		<hidden
			property="db.type"
			value="derby"
		/>
		<hidden
			property="db.schema"
			value="Aperi"
		/>
		<hidden
			property="db.username"
			value="Aperi"
		/>
		<hidden
			property="db.password"
			value="aperi"
		/>
		<hidden
			property="db.derby.heap"
			value="1024m"
		/>
	</page>
	<page
		name="db2Configuration"
		displayText="DB2 Configuration"
		type="input"
		ifProperty="${db.target}==configureDB2">
		<validated
			property="db.username"
			displayText="Username"
			defaultValue="db2admin"
			regex="[a-zA-Z0-9.]*"
		/>
		<text
			property="db.password"
			defaultValue=""
			displayText="Password"
			regex="*"
			textMask="true"
		/>
		<ext-validated
			property="db.port"
			displayText="port"
			defaultValue="50000"
			validationClass="org.eclipse.aperi.install.ValidatePort"
		/>
		<validated
			property="db.driver"
			displayText="Driver"
			defaultValue="com.ibm.db2.jcc.DB2Driver"
			regex="[a-zA-Z0-9.]*"
		/>		
		<directory
			property="db.cmdPath"
			defaultValue=""
			checkExists="true"
			create="true"
			displayText="DB2 Command Line Processor Path"
			defaultValueWin="C:\Program Files\IBM\SQLLIB"
			defaultValueLinux="//home/db2"
		/>
		<hidden
			property="db.type"
			value="db2"
		/>
		<hidden
			property="db.schema"
			value="Aperi"
		/>
	</page>
    <page
			type="progress"
			name="progress"
			showTargets="true"
			displayText="Installation progress" >
	</page>	
</installer>