Index: release-kits/shared/windows/ant-scripts/windows-targets.xml
===================================================================
--- release-kits/shared/windows/ant-scripts/windows-targets.xml	(revision 19847)
+++ release-kits/shared/windows/ant-scripts/windows-targets.xml	(revision 19848)
@@ -8,3 +8,13 @@
 		</copy>
 	</target>
+	
+	<target name="get-copy-of-wrapper-source">
+		<copy todir="${todir}" overwrite="true">
+			<fileset dir="${wirk2.home}/windows/wrapper"/>
+			<fileset dir="${wirk2.home}/greenstone2/wrapper" includes="*.bmp"/>
+			<fileset dir="${wirk2.home}/greenstone2/icon" includes="icon.ico"/>
+			<fileset dir="${wirk2.home}/core/search4j" includes="libsearch4j.cpp,libsearch4j.h"/>
+		</copy>
+	</target>
+
 </project>
Index: release-kits/shared/windows/wirk.cpp
===================================================================
--- release-kits/shared/windows/wirk.cpp	(revision 19847)
+++ release-kits/shared/windows/wirk.cpp	(revision 19848)
@@ -84,5 +84,5 @@
 	//create the command
 	stringstream command;
-	command << "cmd.exe /c " << WIRK_HOME << "\\core\\ant\\bin\\ant.bat -f \"" << WIRK_HOME << "\\ant-scripts\\build.xml\" -addressing \"-Dwirk" << XXX << ".home=" << WIRK_HOME << "\"";
+	command << "c:\\windows\\cmd.exe /c " << WIRK_HOME << "\\core\\ant\\bin\\ant.bat -f \"" << WIRK_HOME << "\\ant-scripts\\build.xml\" -addressing \"-Dwirk" << XXX << ".home=" << WIRK_HOME << "\"";
 
 	//pass on the arguments
Index: release-kits/shared/windows/wrapper/wrapper.cpp
===================================================================
--- release-kits/shared/windows/wrapper/wrapper.cpp	(revision 19847)
+++ release-kits/shared/windows/wrapper/wrapper.cpp	(revision 19848)
@@ -11,5 +11,5 @@
 using namespace std;
 
-#ifdef WEB
+#ifndef CDROM
 #include "libsearch4j.h"
 #endif
@@ -294,6 +294,14 @@
 	
 	//get the original working directory
-	char* owd = _getcwd(NULL, 1024);
-	
+	char* owdChar = _getcwd(NULL, 1024);
+	string owd = "";
+	owd.append( owdChar );
+	delete owdChar;
+	
+	//strip trailing slash
+	if ( owd.substr(owd.length()-1,1).compare( "\\" ) == 0 ) {
+		owd = owd.substr(0, owd.length()-1);
+	}
+		
 	//using the users TMP directory for temp files rather than the current directory so
 	//installation from cdrom works
@@ -305,6 +313,6 @@
 		string title = "Failed to create the temp folder.";
 		string message = "Failed to create the temp folder.\nPlease set the environment variable TMP to a folder you have permission to write to.";
-		ShowWindow(splashWnd, SW_HIDE); //hide splash screen
-		MessageBox(NULL, message.c_str(), title.c_str(), MB_OK);
+		//ShowWindow(splashWnd, SW_HIDE); //hide splash screen
+		MessageBox(splashWnd, message.c_str(), title.c_str(), MB_OK);
 		return -1;
 	}
@@ -313,5 +321,47 @@
 	delete tmp; //  deallocate memory
 	
-	#ifdef WEB
+	#ifdef CDROM
+
+	//ask if they want to install, then do it if so
+	int choice = MessageBox(splashWnd, "Install Greenstone?", "Greenstone", MB_OKCANCEL | MB_ICONQUESTION );
+	if ( choice == IDOK ) {
+
+		//prepare to launch the jar
+		set_splash_step( "LAUNCHING" );
+		spoof_progress( SPOOF_TIME );
+	
+		string cmd = "\"";
+		cmd.append( owd );
+		cmd.append( "\\Java\\Windows\\jre\\bin\\java.exe\" \"-Dorig.dir=" );
+		cmd.append( owd );
+		cmd.append( "\" -jar \"" );
+		cmd.append( owd );
+		cmd.append( "\\Java\\Jars\\windows.jar\"" );
+		char cmdLpstr[1024];
+		strcpy( cmdLpstr, cmd.c_str() );
+		
+		
+		STARTUPINFO si;
+		PROCESS_INFORMATION pi;
+		memset(&pi, 0, sizeof(pi));
+		memset(&si, 0, sizeof(si));
+		si.cb = sizeof(si);
+		DWORD dwExitCode = -1;
+
+		//hide splash screen
+		ShowWindow(splashWnd, SW_HIDE);
+
+		//launch the jar
+		bool result;
+		result = CreateProcess(NULL, cmdLpstr, NULL, NULL, TRUE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
+
+		WaitForSingleObject(pi.hProcess, INFINITE);
+		GetExitCodeProcess(pi.hProcess, &dwExitCode);
+		CloseHandle(pi.hThread);
+		CloseHandle(pi.hProcess);
+
+	}	
+	#else
+
 	//rip out java archive if it is bundled
 	set_splash_step( "XJAVA" );
@@ -348,6 +398,6 @@
 		
 		string title = "Installation Failed: Couldn't find java";
-		ShowWindow(splashWnd, SW_HIDE); //hide splash screen
-		MessageBox(NULL, message.c_str(), title.c_str(), MB_OK);
+		//ShowWindow(splashWnd, SW_HIDE); //hide splash screen
+		MessageBox(splashWnd, message.c_str(), title.c_str(), MB_OK);
 
 	//if java was found, carry on
@@ -380,44 +430,20 @@
 			string title = "Installation Error";
 			string message = "The installation exited with an error. Java may not be installed properly, or the installation may have been interrupted partway through. Please try again.";
-			ShowWindow(splashWnd, SW_HIDE); //hide splash screen
+			//ShowWindow(splashWnd, SW_HIDE); //hide splash screen
 			MessageBox(NULL, message.c_str(), title.c_str(), MB_OK);
 		}
 	}
-
 	#endif
-
-	#ifdef CDROM
-
-	//ask if they want to install, then do it if so
-	int choice = MessageBox(NULL, "Install Greenstone?", "Greenstone", MB_OKCANCEL | MB_ICONQUESTION );
-	if ( choice == IDOK ) {
-
-		//launch the jar
-		set_splash_step( "LAUNCHING" );
-		spoof_progress( SPOOF_TIME );
-		string cmd = "\"";
-		cmd.append( owd );
-		cmd.append( "\\Java\\Windows\\jre\\bin\\java.exe\" \"-Dorig.dir=" );
-		cmd.append( owd );
-		cmd.append( "\" -jar greenstone.jar" );
-
-		//hide splash screen
-		ShowWindow(splashWnd, SW_HIDE);
-		
-		//run the jar
-		int launch_exit_code = process( cmd, false );
-	}
-
-	#endif
 	
 	//clean up the temp directory
+	_unlink( "ant.install.log" );
+	#ifndef CDROM
 	_unlink( "greenstone.jar" );
-	_unlink( "ant.install.log" );
 	_unlink( "@java.installer@" );
 	process( "cmd.exe /c rd /s /q @java.extracted@", false );
+	#endif
+
 	SetCurrentDirectory( ".." );
 	_rmdir( tempdir.c_str() );
-
-	delete owd;
 	
 	return 0;
