Index: /release-kits/lirk2/installer/antinstall-config.xml
===================================================================
--- /release-kits/lirk2/installer/antinstall-config.xml	(revision 19754)
+++ /release-kits/lirk2/installer/antinstall-config.xml	(revision 19755)
@@ -48,5 +48,5 @@
 
 		<directory property="installDir"
-			defaultValue="/usr/local/Greenstone2"
+			defaultValue="/usr/local/Greenstone2,${env.HOME}/Greenstone2"
 			create="true"
 			displayText=""
Index: /release-kits/lirk3/installer/antinstall-config.xml
===================================================================
--- /release-kits/lirk3/installer/antinstall-config.xml	(revision 19754)
+++ /release-kits/lirk3/installer/antinstall-config.xml	(revision 19755)
@@ -45,5 +45,5 @@
 
 		<directory property="installDir"
-			defaultValue="/usr/local/Greenstone3"
+			defaultValue="/usr/local/Greenstone3,${env.HOME}/Greenstone3"
 			create="true"
 			displayText=""
Index: /release-kits/mark2/installer/antinstall-config.xml
===================================================================
--- /release-kits/mark2/installer/antinstall-config.xml	(revision 19754)
+++ /release-kits/mark2/installer/antinstall-config.xml	(revision 19755)
@@ -46,5 +46,5 @@
 
 		<directory property="installDir"
-			defaultValue="/usr/local/Greenstone2"
+			defaultValue="/usr/local/Greenstone2,${env.HOME}/Greenstone2"
 			create="true"
 			displayText=""
Index: /release-kits/mark3/installer/antinstall-config.xml
===================================================================
--- /release-kits/mark3/installer/antinstall-config.xml	(revision 19754)
+++ /release-kits/mark3/installer/antinstall-config.xml	(revision 19755)
@@ -46,5 +46,5 @@
 
 		<directory property="installDir"
-			defaultValue="/usr/local/Greenstone3"
+			defaultValue="/usr/local/Greenstone3,${env.HOME}/Greenstone3"
 			create="true"
 			displayText=""
Index: /release-kits/shared/core/ant-installer/src/org/tp23/antinstaller/input/DirectoryInput.java
===================================================================
--- /release-kits/shared/core/ant-installer/src/org/tp23/antinstaller/input/DirectoryInput.java	(revision 19754)
+++ /release-kits/shared/core/ant-installer/src/org/tp23/antinstaller/input/DirectoryInput.java	(revision 19755)
@@ -17,5 +17,7 @@
 
 import java.io.File;
+import java.io.IOException;
 import java.util.ResourceBundle;
+import java.util.ArrayList;
 
 import org.tp23.antinstaller.InstallerContext;
@@ -37,4 +39,7 @@
     private String create;
     private String checkExists;
+
+	//to make default install directory choice smart
+	private String decidedDefault = null;
 
 	//to detect previous installations
@@ -98,4 +103,54 @@
 	}
 
+	public String getDefaultValue(boolean correctForOS) {
+
+		if ( this.defaultValue == null ) {
+			return null;
+		}
+
+		if ( decidedDefault != null ) {
+			return decidedDefault;
+		}
+
+		String[] defaultsArray = defaultValue.split(",");
+		for ( int i=0; i<defaultsArray.length; i++ ) {
+			String def = resultContainer.getDefaultFileRef(defaultsArray[i]);
+			File defFile = new File( def );
+
+			//if the path is a file, go to next
+			if ( defFile.isFile() ) {
+				continue;
+			}
+
+			//if the path is a directory, try to write a little file to it
+			if ( defFile.isDirectory() ) {
+				File testFile = new File( defFile, "ant-installer-test-file-(ok-to-delete)" );
+				boolean result = false;
+				try { result = testFile.createNewFile(); } catch ( IOException ioe ) {}
+				if ( result ) {
+					decidedDefault = def;
+					try { testFile.delete(); } catch ( SecurityException se ) {}
+					return decidedDefault;
+				}
+			}
+
+			//if the path doesn't exist, try to create it as a directory
+			if ( !defFile.exists() ) {
+				if ( defFile.mkdir() ) {
+					decidedDefault = def;
+					try { defFile.delete(); } catch ( SecurityException se ) {}
+					return decidedDefault;
+				}
+			}
+			
+		}
+
+		decidedDefault = resultContainer.getDefaultFileRef(
+			defaultsArray[defaultsArray.length-1]
+			);
+		return decidedDefault;
+
+	}
+
 	public boolean isAbort() {
 		return abort;
@@ -154,9 +209,9 @@
 			return false;
 		}
-		if(getDefaultValue() == null){
+		if(defaultValue == null){
 			System.out.println("Directory:defaultValue must be set");
 			return false;
 		}
-        if(getDefaultValue().equals("")){
+        if(defaultValue.equals("")){
             if( isTrue(getCreate()) || isTrue(getCheckExists()) ) {
                 System.out.println("Directory:defaultValue must be set if checkExists or create are true");
Index: /release-kits/wirk2/installer/antinstall-config.xml
===================================================================
--- /release-kits/wirk2/installer/antinstall-config.xml	(revision 19754)
+++ /release-kits/wirk2/installer/antinstall-config.xml	(revision 19755)
@@ -46,5 +46,5 @@
 	<!-- Because of Vista UAC related issues, it is now preferred to install Greenstone where the current user has full privileges -->
 		<directory property="installDir"
-			defaultValue="${env.HOMEDRIVE}\${env.HOMEPATH}\Greenstone2"
+			defaultValue="C:\Program Files\Greenstone2,${env.HOMEDRIVE}\${env.HOMEPATH}\Greenstone2"
 			create="true"
 			displayText=""
Index: /release-kits/wirk3/installer/antinstall-config.xml
===================================================================
--- /release-kits/wirk3/installer/antinstall-config.xml	(revision 19754)
+++ /release-kits/wirk3/installer/antinstall-config.xml	(revision 19755)
@@ -46,5 +46,5 @@
 	<!-- Because of Vista UAC related issues, it is now preferred to install Greenstone where the current user has full privileges -->
 		<directory property="installDir"
-			defaultValue="${env.HOMEDRIVE}\${env.HOMEPATH}\Greenstone3"
+			defaultValue="C:\Program Files\Greenstone3,${env.HOMEDRIVE}\${env.HOMEPATH}\Greenstone3"
 			create="true"
 			displayText=""
