Index: /release-kits/wirk3/ant-scripts/build.xml
===================================================================
--- /release-kits/wirk3/ant-scripts/build.xml	(revision 15094)
+++ /release-kits/wirk3/ant-scripts/build.xml	(revision 15095)
@@ -15,5 +15,4 @@
 	<import file="compile.xml"/>
 	<import file="create-distribution.xml"/>
-	<import file="create-launcher.xml"/>
 	<import file="create-installer.xml"/>
 	<import file="wrap.xml"/>
@@ -24,5 +23,4 @@
 		<addressedcall target="compile"/>
 		<addressedcall target="create-distribution"/>
-		<addressedcall target="create-launcher"/>
 		<addressedcall target="create-installer"/>
 		<addressedcall target="wrap"/>
Index: /release-kits/wirk3/ant-scripts/create-distribution.xml
===================================================================
--- /release-kits/wirk3/ant-scripts/create-distribution.xml	(revision 15094)
+++ /release-kits/wirk3/ant-scripts/create-distribution.xml	(revision 15095)
@@ -59,5 +59,5 @@
 	<target name="create-distributions-2">
 		<if><bool><istrue value="${execute}"/></bool>
-			<ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-2"  inheritAll="false">
+			<ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-2" inheritAll="false">
 				<property name="app.version" value="${version}"/>
 				<property name="branch.path" value="${branch.path}"/>
@@ -69,5 +69,5 @@
 	<target name="create-distributions-3">
 		<if><bool><istrue value="${execute}"/></bool>
-			<ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-3"  inheritall="false">
+			<ant antfile="${wirk3.home}/ant-scripts/operations-on-gs3home.xml" dir="distribution/greenstone3" target="create-distribution-3" inheritall="false">
 				<property name="app.version" value="${version}"/>
 				<property name="branch.path" value="${branch.path}"/>
Index: /release-kits/wirk3/ant-scripts/wrap.xml
===================================================================
--- /release-kits/wirk3/ant-scripts/wrap.xml	(revision 15094)
+++ /release-kits/wirk3/ant-scripts/wrap.xml	(revision 15095)
@@ -11,4 +11,5 @@
 <project name="wirk3-wrap" default="wrap">
 	<property name="java.installer" value="jre-6u3-windows-i586-p-s.exe"/>
+	<property name="java.min.version" value="1.5.0_00"/>
 
 
@@ -23,4 +24,5 @@
 		<if><bool><istrue value="${execute}"/></bool>
 
+			<!--create a directory to build the wrapped installer in -->
 			<mkdir dir="${basedir}/wrapped-installer/build"/>
 			<copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/wrapper/wrapper.cpp"/>
@@ -28,14 +30,16 @@
 			<copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/wrapper/wrapper-with-jre.rc"/>
 
-			<!-- resources to bundle -->
+			<!-- copy resources to bundle -->
 			<copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/icon/gs3.ico"/>
 			<copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/wrapper/${java.installer}"/>
+			<copy todir="${basedir}/wrapped-installer/build" file="${wirk3.home}/search4j/search4j.exe"/>
 			<copy tofile="${basedir}/wrapped-installer/build/greenstone3.jar" file="${basedir}/installer/greenstone-${version}-win32.jar"/>
-			<copy todir="${basedir}/wrapped-installer/build" file="${basedir}/launcher/launch-installer.exe"/>
+			
 
-			<!-- substitute in the real java installer filename -->
+			<!-- substitute the real java installer filename and min version into various files -->
 			<rsr file="${basedir}/wrapped-installer/build/wrapper.rc" pattern="@java.installer@" replacement="${java.installer}"/>
 			<rsr file="${basedir}/wrapped-installer/build/wrapper-with-jre.rc" pattern="@java.installer@" replacement="${java.installer}"/>
 			<rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.installer@" replacement="${java.installer}"/>
+			<rsr file="${basedir}/wrapped-installer/build/wrapper.cpp" pattern="@java.min.version@" replacement="${java.min.version}"/>
 
 			
@@ -65,5 +69,5 @@
 			</exec>
 			<exec executable="link" dir="${basedir}/wrapped-installer/build">
-				<arg line="/OUT:..\greenstone-${version}-win32-with-jre.exe wrapper.obj wrapper-with-jre.res"/>
+				<arg line="/OUT:..\greenstone-${version}-win32-with-java.exe wrapper.obj wrapper-with-jre.res"/>
 			</exec>
 		</if>
Index: /release-kits/wirk3/installer/antinstall-config.xml
===================================================================
--- /release-kits/wirk3/installer/antinstall-config.xml	(revision 15094)
+++ /release-kits/wirk3/installer/antinstall-config.xml	(revision 15095)
@@ -43,5 +43,5 @@
 	<page type="input" name="tomcatports" displayText="Tomcat Ports">
 
-		<comment displayText="Please select the ports which the web server (Apache Tomcat) will use  will use. It is usually safe to accept the defaults by just clicking Next. The exception is when you are running other services on these ports - if this is the case, select some free ports and click Next."/>
+		<comment name="tomcatportsdescription" displayText="Please select the ports which the web server (Apache Tomcat) will use  will use. It is usually safe to accept the defaults by just clicking Next. The exception is when you are running other services on these ports - if this is the case, select some free ports and click Next."/>
 
 		<text property="tomcat.server" defaultValue="localhost" displayText="Tomcat Server"/>
@@ -56,4 +56,5 @@
 			displayText="Components to install">
 		<comment
+				name="choosecomponents"
 				displayText="Choose the components you want to install"
 				bold="true"/>
Index: /release-kits/wirk3/installer/build.xml
===================================================================
--- /release-kits/wirk3/installer/build.xml	(revision 15094)
+++ /release-kits/wirk3/installer/build.xml	(revision 15095)
@@ -16,4 +16,11 @@
 	<typedef name="rsr" classname="RegexSearchReplace" classpathref="project.classpath"/>
 
+	<!-- create a local installDir String -->
+	<path id="installDir.path">
+		<pathelement location="${installDir}"/>
+	</path>
+	<property name="installDir.local" refid="installDir.path"/>
+	
+	
 	<target name="default" depends="">
 
@@ -84,33 +91,36 @@
 		<!-- change the tomcat ports in tomcats server.xml -->
 		<echo message="Changing tomcat ports tomcat's server.xml"/>
-		<copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir}/packages/tomcat/conf/server.xml" overwrite="true"/>
-		<rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@port@(.*)" replacement="$1${tomcat.port}$2" />
-		<rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="(.*)@shutdown-port@(.*)" replacement="$1${tomcat.shutdown.port}$2" />
+		<copy file="${installDir}/resources/tomcat/server.xml" tofile="${installDir.local}/packages/tomcat/conf/server.xml" overwrite="true"/>
+		<rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@port@" replacement="${tomcat.port}" />
+		<rsr file="${installDir}/packages/tomcat/conf/server.xml" pattern="@shutdown-port@" replacement="${tomcat.shutdown.port}" />
 		
 		<!-- copy the greenstone3.xml file to tomcat -->
 		<echo message="Copying greenstone3.xml to tomcat directory"/>
 		<copy file="${installDir}/resources/tomcat/greenstone3.xml" tofile="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" overwrite="true"/>
-		<rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="(.*)@gsdl3webhome@(.*)" replacement="$1${installDir}/web$2" />
+		<rsr file="${installDir}/packages/tomcat/conf/Catalina/localhost/greenstone3.xml" pattern="@gsdl3webhome@" replacement="${installDir.local}\web" />
 
 		<!-- set up global properties -->
 		<echo message="Setting up global properties"/>
 		<copy file="${installDir}/resources/java/global.properties.in" tofile="${installDir}/web/WEB-INF/classes/global.properties" overwrite="true"/>
-		<rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
-		<rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.server@(.*)" replacement="$1localhost$2" />
-		<rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="(.*)@tomcat.port@(.*)" replacement="$1${tomcat.port}$2" />
+		<rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
+		<rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.server@" replacement="${tomcat.server}" />
+		<rsr file="${installDir}/web/WEB-INF/classes/global.properties" pattern="@tomcat.port@" replacement="${tomcat.port}" />
 
 		<!-- set up log4j properties-->
 		<echo message="Setting up log4j properties"/>
 		<copy file="${installDir}/resources/java/log4j.properties.in" tofile="${installDir}/web/WEB-INF/classes/log4j.properties" overwrite="true"/>
-		<rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="(.*)@gsdl3home@(.*)" replacement="$1${installDir}/web$2" />
+		<rsr file="${installDir}/web/WEB-INF/classes/log4j.properties" pattern="@gsdl3home@" replacement="${installDir.local}\web" />
 
 		<!-- get the found JRE_HOME -->
-		<exec executable="cmd" dir="${installDir}" outputproperty="backup.jre.home"><arg line="/C launch-installer.exe -find"/></exec>
+		<exec executable="search4j.exe" outputproperty="backup.jre.home"><arg line="-m @java.min.version@"/></exec>
 				
 		<!-- in the gs3-setup.sh file, set ANT_HOME and put it in PATH, and set the fallback JRE_HOME -->
 		<echo>In the gs3-setup.sh file, set ANT_HOME and put it in PATH</echo>
-		<exec executable="cmd" output="${installDir}/machine.bat" append="true"><arg line="/C echo set ANT_HOME=${installDir}/packages/ant"/></exec>
-		<exec executable="cmd" output="${installDir}/machine.bat" append="true"><arg line="/C echo set PATH=\%ANT_HOME\%/bin:\%PATH\%"/></exec>
-		<exec executable="cmd" output="${installDir}/machine.bat" append="true"><arg line="/C echo set BACKUP_JRE_HOME=${backup.jre.home}"/></exec>
+		<concat destfile="${installDir}/machine.bat" append="yes">
+set ANT_HOME=${installDir}\packages\ant
+set PATH=%ANT_HOME%\bin;%PATH%
+set BACKUP_JAVA_HOME=${backup.jre.home}
+</concat>
+		
 
 		<!-- delete unneeded files -->	    
Index: /release-kits/wirk3/installer/cp/resources/LanguagePack_zh_CN.properties
===================================================================
--- /release-kits/wirk3/installer/cp/resources/LanguagePack_zh_CN.properties	(revision 15095)
+++ /release-kits/wirk3/installer/cp/resources/LanguagePack_zh_CN.properties	(revision 15095)
@@ -0,0 +1,30 @@
+### Ant Installer - language pack auto generated on Wed Mar 12 13:57:47 NZDT 2008
+
+finishButtonText =  Finish(zh)
+
+
+## Text from Page:intro
+intro.displayText = Greenstone(zh)
+
+## Text from Page:license
+license.displayText = License conditions(zh)
+
+## Text from Page:destination
+destination.displayText = Install Destination(zh)
+installDir.displayText = Select an installation directory(zh)
+
+## Text from Page:tomcatports
+tomcatports.displayText = Tomcat Ports(zh)
+tomcatportsdescription.displayText = Please select the ports which the web server (Apache Tomcat) will use  will use. It is usually safe to accept the defaults by just clicking Next. The exception is when you are running other services on these ports - if this is the case, select some free ports and click Next.(zh)
+tomcat.server = Tomcat Server(zh)
+tomcat.port.displayText = Tomcat Port(zh)
+tomcat.shutdown.port.displayText = Tomcat Shutdown Port(zh)
+
+## Text from Page:selector
+selector.displayText = Components to install(zh)
+choosecomponents.displayText = Choose the components you want to install(zh)
+default.displayText = Core components(zh)
+tgsrc.displayText = Source code(zh)
+
+## Text from Page:progress
+progress.displayText = Installation progress(zh)
Index: /release-kits/wirk3/src/wirk3.cpp
===================================================================
--- /release-kits/wirk3/src/wirk3.cpp	(revision 15094)
+++ /release-kits/wirk3/src/wirk3.cpp	(revision 15095)
@@ -84,5 +84,12 @@
 	//command = command + ".";
 
-	cout << "---------" << endl << "  WiRK3" << endl << "---------" << endl;
+	cout
+		<< "O-----------------------------------------O" << endl
+		<< "|                                         |" << endl
+		<< "|   WiRK3                                 |" << endl
+		<< "|   Windows Release Kit for Greenstone3   |" << endl
+		<< "|                                         |" << endl
+		<< "O-----------------------------------------O" << endl
+		;
 	
 	cout << "pwd: " << pwd << endl;
Index: /release-kits/wirk3/wrapper/wrapper-with-jre.rc
===================================================================
--- /release-kits/wirk3/wrapper/wrapper-with-jre.rc	(revision 15094)
+++ /release-kits/wirk3/wrapper/wrapper-with-jre.rc	(revision 15095)
@@ -1,4 +1,4 @@
 GREENSTONE_JAR JAR "greenstone3.jar"
-LAUNCHER EXE "launch-installer.exe"
+SEARCH4J EXE "search4j.exe"
 JAVA EXE "@java.installer@"
 MAINICON ICON "gs3.ico"
Index: /release-kits/wirk3/wrapper/wrapper.cpp
===================================================================
--- /release-kits/wirk3/wrapper/wrapper.cpp	(revision 15094)
+++ /release-kits/wirk3/wrapper/wrapper.cpp	(revision 15095)
@@ -3,4 +3,7 @@
 #include <fstream>
 #include <iostream>
+#include <conio.h>
+#include <string>
+#include <time.h>
 
 using namespace std;
@@ -37,66 +40,110 @@
 }
 
-void main()
-{
-	
+void cleanup( string dir, string file ) {
+	string command = "if EXIST ";
+	command.append( dir );
+	command.append( "\\" );
+	command.append( file );
+	command.append( " del " );
+	command.append( dir );
+	command.append( "\\" );
+	command.append( file );
+	system( command.c_str() );
+}
+
+void main() {
+	string command;
+	srand( time(0) );
+
 	cout << "Greenstone3 Installer" << endl;
 		
 	//create the temp folder
-	cout << "Creating temp folder 'greenstone3.tmp' ..." << endl;
-	system("mkdir greenstone3.tmp");
+	char id[6]; for( int i=0; i<5; i++ ) id[i] = (char)((rand()%26) + 97); id[5] = '\0'; //id for this instance
+	string tempdir = "greenstone3.tmp"; tempdir.append( id ); //the temp dir
+
+	cout << "Creating temp folder '";
+	cout << tempdir;
+	cout << "' ..." << endl;	
+	command = "mkdir ";	command.append(tempdir);
+	system( command.c_str() );
 	
 	//extract the resources
-	cout << "Extracting jar launcher ..." << endl;
-	extractResource( "LAUNCHER", "EXE", "greenstone3.tmp\\launch-installer.exe" );
+	cout << "Extracting search4j tool ..." << endl;
+	string search4jLocation = ""; search4jLocation.append( tempdir ); search4jLocation.append( "\\search4j.exe" );
+	extractResource( "SEARCH4J", "EXE", (char*) search4jLocation.c_str() );
 	
 	cout << "Extracting jar installer ..." << endl;
-	extractResource( "GREENSTONE_JAR", "JAR", "greenstone3.tmp\\greenstone3.jar" );
-				
+	string jarLocation = ""; jarLocation.append( tempdir ); jarLocation.append( "\\greenstone3.jar" );
+	extractResource( "GREENSTONE_JAR", "JAR", (char*) jarLocation.c_str() );
+	
 	//change to the temp directory and start the jar
-	SetCurrentDirectory("greenstone3.tmp");
+	SetCurrentDirectory( tempdir.c_str() );
 
-	//launch the jar with launch4j, taking a note of the exit code or info in the log
-	cout << "Launching Installer ..." << endl;
-	int launch_exit_code = 0;
-	launch_exit_code = system("launch-installer.exe");
-			
-	//if it failed, launch the installer for the bundled java, then try again
-	if ( launch_exit_code == 1 ) {
-		cout << "Greenstone requires Java Runtime Enviromnent (JRE) 1.4.0 or greater" << endl;
-		cout << "It appears that you do not have an a suitible JRE installed" << endl;
-
+	//check if an appropriate java is found
+	bool jvmFound = (system( "search4j.exe -m @java.min.version@" ) == 0);
+	
+	//if the jvm was not found, try to fix it and find it
+	if ( !jvmFound ) {
+		//did not find a good java
+		cout << "Greenstone requires java @java.min.version@ or greater" << endl;
+		
+		//tell them if java is absent or just too old
+		if ( system( "search4j.exe" ) == 0 ) {
+			cout << "Your java is too old." << endl;
+		} else {
+			cout << "Could not find java." << endl;
+		}
 		
 		//is this an installer with the bundled JRE?
-		cout << "Extracting java installer ..." << endl;
+		cout << "Checking for bundled java ..." << endl;
 		int extract_result = extractResource( "JAVA", "EXE", "@java.installer@" );
 		if ( extract_result == 0 ) {
-			
 			//yes, JRE is bundled
-			cout << "Starting the installation process for the bundled JRE" << endl;	
-			system( "@java.installer@" );
-			launch_exit_code = system("launch-installer.exe");
-			if ( launch_exit_code == 1 ) {
-				cout << "Still could not find a JRE. Please install a JRE and try again." << endl;
+			cout
+				<< "This installer comes bundled with a suitible version of java: " << endl
+				<< "   @java.installer@" << endl
+				<< "Do you want to install this java? (y/n)" << endl;
+			char r[1024]; cin >> r;
+			if ( _stricmp( r, "y" ) == 0 ) {
+				system( "@java.installer@" );
 			}
-			
+			jvmFound = true; //assume the java installation went well
 		} else {
-			
 			//no, JRE is not bundled
-			cout << "Sorry, there is no bundled JRE" << endl;
-			cout << "Install a JRE and try again (make sure JRE_HOME is set)" << endl;
-			cout << "Or, download a greentsone3 installer with a bundled JRE and use that instead of this one" << endl;
+			cout << "Sorry, there is no bundled java with this installer" << endl;
+			cout << "Install java (@java.min.version@ or newer) and try again" << endl;
+			cout << "Or, download a greentsone3 installer with bundled java and use that instead of this one" << endl;
+		}
+	}
+	
+	//if we have found it by now, launch the installer
+	if ( jvmFound ) {
+		//launch the jar with search4j, taking a note of the exit code
+		cout << "Launching Installer ..." << endl;
+		int launch_exit_code = 0;
+		launch_exit_code = system("search4j.exe -m @java.min.version@ -l greenstone3.jar");
 		
+		//if it failed, launch the installer for the bundled java, then try again
+		if ( launch_exit_code == 0 ) {
+			cout << "Setup complete" << endl;
+		} else {
+			cout << "Still could not find a suitible version of java" << endl;
+			cout << "Please install java and try again" << endl;
 		}
-		system("if EXISTS greenstone3.tmp\\@java.installer@ del greenstone3.tmp\\@java.installer@");
-		
 	}
 	
 	//change back to the original directory and clean up the temp directory
 	SetCurrentDirectory("..");
-	system("if EXISTS greenstone3.tmp\\greenstone3.jar del greenstone3.tmp\\greenstone3.jar");
-	system("if EXISTS greenstone3.tmp\\launch-installer.exe del greenstone3.tmp\\launch-installer.exe");
-	system("if EXISTS greenstone3.tmp\\ant.install.log del greenstone3.tmp\\ant.install.log");
-	system("rmdir greenstone3.tmp");
+
+	cleanup(tempdir, "greenstone3.jar" );
+	cleanup(tempdir, "search4j.exe");
+	cleanup(tempdir, "ant.install.log");
+	cleanup(tempdir, "@java.installer@");
 	
+	command = "rmdir ";
+	command.append( tempdir );
+	system( command.c_str() );
+	cout << "Press any key to exit..." << endl;
+	getch();
 	
 }
Index: /release-kits/wirk3/wrapper/wrapper.rc
===================================================================
--- /release-kits/wirk3/wrapper/wrapper.rc	(revision 15094)
+++ /release-kits/wirk3/wrapper/wrapper.rc	(revision 15095)
@@ -1,4 +1,4 @@
 GREENSTONE_JAR JAR "greenstone3.jar"
-LAUNCHER EXE "launch-installer.exe"
+SEARCH4J EXE "search4j.exe"
 MAINICON ICON "gs3.ico"
 
