Jump to: navigation, search

Difference between revisions of "Aperi/Design Proposals"

(Sample Install Project)
(Sample Install Project)
Line 33: Line 33:
  
 
=== Sample Install Project ===
 
=== Sample Install Project ===
 +
This install project was created to evaluate the AntInstaller features.  It is not a full implementation of the Aperi install.
 
==== Screenshots ====
 
==== Screenshots ====
 
[[Image:Aperi_sampleInstallerScreenshot_1.JPG]]
 
[[Image:Aperi_sampleInstallerScreenshot_1.JPG]]

Revision as of 13:30, 9 May 2007

Proposal

Migrate the ConfigureAperi code to AntInstaller.

Ant Installer Project

Licensing

  • AntInstall - Apache 2.0
  • SysOut - Apache 2.0
  • Ant - Apache 2.0
  • DOM - license
  • SAX - license
  • Xerces - Apache 1.1
  • JGoodies - BSD

Motivation

  1. Using AntInstaller reduces the need for custom Java code because the installer inherits configuration functions from ant
  2. The installer will be easier to maintain
    1. Less code to maintain
    2. Most maintenance changes will only require XML changes
  3. Graphical interface is user friendly
    1. Command line and silent installs also supported.
  4. Easy for Aperi users/adopters to change the branding, look and behavior of the installer.
    1. Menus and icons can be updated in XML
    2. The install behavior can be changed by updating the XML
    3. Adopters can ship just the build.xml, properties file and the ant binaries.

Other Options Considered

  1. IzPack
  2. Install Anywhere


Sample Install Project

This install project was created to evaluate the AntInstaller features. It is not a full implementation of the Aperi install.

Screenshots

Aperi sampleInstallerScreenshot 1.JPG Aperi sampleInstallerScreenshot 2.JPG Aperi sampleInstallerScreenshot 3.JPG Aperi sampleInstallerScreenshot 4.JPG Aperi sampleInstallerScreenshot 5.JPG Aperi sampleInstallerScreenshot 6.JPG Aperi sampleInstallerScreenshot 8.JPG Aperi sampleInstallerScreenshot 9.JPG

Input: Antinstall-config.xml


<?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)--" />
    <page
        type="input"
        name="intro"
        displayText="Welcome">
        <comment
            displayText=""
            explanatoryText="This is a demo of the Aperi installer using antinstaller."
            />
        <comment displayText=""/>
        <comment displayText="Installer made with"/>
        <comment displayText="http://antinstaller.sourceforge.net" bold="true"/>
 		<hidden
 			property="env.HOSTNAME"
 			value="${env.COMPUTERNAME}"
 		/>
    </page>
    <page
        type="license"
        name="license"
        displayText="License conditions"
        resource="/resources/EPL.txt"
        target="default"
        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"/>
		</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="configureGUI"
        	displayText="GUI"
        	defaultValue="true"
        	osSpecific="true"
        	strict="false" />
    </page>
    <page
      	type="input"
    	name="installLocation"
    	displayText="Installation location" >
    	<directory
    		displayText="Installation location"
    		checkExists="true"
    		create="true"
    		defaultValue="/opt/Aperi"
    		defaultValueWin="C:\Program files\Aperi"
    		property="install.dir" />
    </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" />
	</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="${env.HOSTNAME}"
			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"
		/>
		<hidden
			property="server.reporting.port"
			value="8080"
		/>
		<directory
			property="server.reporting.dir"
			defaultValue="${user.dir}/reporting/reportRepo"
			checkExists="true"
			create="true"
			displayText="Report server repository path"
			defaultValueWin="${install.dir}/reporting/reportRepo"
		/>
		<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==Derby">
		<ext-validated
			property="db.port"
			displayText="Database port"
			defaultValue="1527"
			validationClass="org.eclipse.aperi.install.ValidatePort"
		/>
		<validated
			property="db.driver"
			displayText="Driver"
			defaultValue="org.apache.derby.jdbc.ClientDriver"
			regex="[a-zA-Z0-9.]*"
		/>
		<hidden
			property="db.type"
			value="derby"
		/>
		<hidden
			property="db.schema"
			value="Aperi"
		/>
		<hidden
			property="db.username"
			value="Aperi"
		/>
		<hidden
			property="db.password"
			value="aperi"
		/>
	</page>
	<page
		name="db2Configuration"
		displayText="DB2 Configuration"
		type="input"
		ifProperty="db==DB2">
		<validated
			property="db.username"
			displayText="Username"
			defaultValue="db2admin"
			regex="[a-zA-Z0-9.]*"
		/>
		<password
			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="false"
			displayText="DB2 Command Line Processor Path"
			defaultValueWin=""
		/>
		<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>

Input: build.xml


<?xml version="1.0"?>
<project name="Aperi installer build"  default=""  basedir="${basedir}">

	<!-- this is required to pick up the properties generated during the install pages -->
	<property file="${basedir}/ant.install.properties"/>

	<target name="default" depends="">
		<echo>"Default"</echo>
	</target>
	<target name="configureDerby" depends="">
		<echo>"Derby"</echo>
	</target>
	<target name="configureDB2" depends="">
		<echo>"DB2"</echo>
	</target>
	<target name="configureServer-win" depends="">
		<echo>"Configuring the Data server"</echo>
		
		<echo>"Updating the properties file: ${install.dir}/datasvr/configuration/server.config</echo>
		<replaceregexp byline="false">
		  <regexp pattern="(name=)("?)(.*)("?)"/>
		  <substitution expression="\1"${env.HOSTNAME}""/>
		  <fileset 
		  	dir="${install.dir}/datasvr/configuration"
		  	includes="server.config" />
		 </replaceregexp>
		<replaceregexp byline="false">
		  <regexp pattern="(port=)("?)(.*)("?)"/>
		  <substitution expression="\1"${server.data.port}""/>
		  <fileset 
		  	dir="${install.dir}/datasvr/configuration"
		  	includes="server.config" />
		 </replaceregexp>
		<replaceregexp byline="false">
		  <regexp pattern="(driver=)("?)(.*)("?)"/>
		  <substitution expression="\1"${db.driver}""/>
		  <fileset 
		  	dir="${install.dir}/datasvr/configuration"
		  	includes="server.config" />
		 </replaceregexp>
		<replaceregexp byline="false">
		  <regexp pattern="(url=)("?)(.*)("?)"/>
		  <substitution expression="\1"jdbc:${db.type}://${env.HOSTNAME}:${db.port}/${db.schema}""/>
		  <fileset 
		  	dir="${install.dir}/datasvr/configuration"
		  	includes="server.config" />
		 </replaceregexp>
		<replaceregexp byline="false">
		  <regexp pattern="(user=)("?)(.*)("?)"/>
		  <substitution expression="\1"${db.user}""/>
		  <fileset 
		  	dir="${install.dir}/datasvr/configuration"
		  	includes="server.config" />
		 </replaceregexp>
		<replaceregexp byline="false">
		  <regexp pattern="(schema=)("?)(.*)("?)"/>
		  <substitution expression="\1"${db.schema}""/>
		  <fileset 
		  	dir="${install.dir}/datasvr/configuration"
		  	includes="server.config" />
		 </replaceregexp>
		<replaceregexp byline="false">
		  <regexp pattern="(reportServerPort=)("?)(.*)("?)"/>
		  <substitution expression="\1"${server.reporting.port}""/>
		  <fileset 
		  	dir="${install.dir}/datasvr/configuration"
		  	includes="server.config" />
		 </replaceregexp>
		<echo>"Updating the file: ${install.dir}/datasvr/server.bat</echo>
		<echo>"     Updating path"</echo>
		<replaceregexp byline="false">
		  <regexp pattern="(set PATH=)(.*)"/>
		  <substitution expression="\1${install.dir}/lib/w32-ix86;%PATH%"/>
		  <fileset 
		  	dir="${install.dir}/datasvr"
		  	includes="datasvr.bat" />
		 </replaceregexp>
		<echo>"     Updating cd"</echo>
		<replaceregexp byline="false">
		  <regexp pattern="(cd )(.*)"/>
		  <substitution expression="cd ${install.dir}/db"/>
		  <fileset 
		  	dir="${install.dir}/datasvr"
		  	includes="datasvr.bat" />
		 </replaceregexp>
		<echo>"     Updating Java path"</echo>
		 <replaceregexp byline="false">
		  <regexp pattern="("?)(.*)(java)("?)"/>
		  <substitution expression="${java.home}/bin/java"/>
		  <fileset 
		  	dir="${install.dir}/datasvr"
		  	includes="datasvr.bat" />
		 </replaceregexp>
		<echo>"     Updating heap size"</echo>
		<replaceregexp byline="false">
		  <regexp pattern="(-Xmx)([0-9m]*)"/>
		  <substitution expression="-Xmx${server.data.heap}"/>
		  <fileset 
		  	dir="${install.dir}/datasvr"
		  	includes="datasvr.bat" />
		 </replaceregexp>
		<echo>"     Updating permissions"</echo>
		<chmod perm="ugo+x" file="${install.dir}/datasvr/datasvr.bat" />
	</target>
	<target name="configureServer-linux" depends="">
		<echo>server-linux</echo>
	</target>
	<target name="configureAgent-win" depends="">
		<echo>agent-win</echo>
	</target>
	<target name="configureAgent-linux" depends="">
		<echo>agent-linux</echo>
	</target>
	<target name="configureGUI-win" depends="">
		<echo>gui-win</echo>
	</target>
	<target name="configureGUI-linux" depends="">
		<echo>gui-linux</echo>
	</target>
</project>