Index: AE/Installer/trunk/source/installer.cpp
===================================================================
--- AE/Installer/trunk/source/installer.cpp	(revision 491)
+++ AE/Installer/trunk/source/installer.cpp	(revision 496)
@@ -1143,4 +1143,5 @@
 #ifdef WIN32
 	// TODO: Fill in Windows equivalent of code below :-3
+	popenCommand = "replace_installer.bat";
 #else
 	// We can't just use '~' to mean "the home directory" because we need to check the path in C...
@@ -1164,6 +1165,9 @@
 	file.close();
 	file.clear();
+#ifdef WIN32
+	system(popenCommand.c_str());
+#else
 	popen(popenCommand.c_str(), "r");
-	
+#endif
 	return true; // returning 'true' tells the Installer to quit itself ASAP so it can be replaced by the process that is now running
 }
@@ -1196,5 +1200,5 @@
 	// TODO: Fill in Windows equivalent of code below
 #ifdef WIN32
-	string strTrashDir = "%RECYCLE%";
+	string strTrashDir = "Trash\\";
 #else
 	FILE *fUserName = NULL;
@@ -1241,5 +1245,5 @@
 		}
 	}
-	
+#ifndef WIN32
 	if (!*installerJustUpdated || needNewTrashDir) // prepare a new directory for deleted files to go to
 	{
@@ -1249,4 +1253,5 @@
 		create_directory(strTrashDir);
 	}
+#endif
 	file.close();
 	file.clear();
@@ -1324,5 +1329,9 @@
 				aParentPath = aParentPath + "/";
 			}
+#ifndef WIN32
 			rename((path)("../" + thePath), (path)(strTrashDir + thePath));
+#else
+			remove((path)("../" + thePath));
+#endif
 		}
 	}
@@ -1347,5 +1356,9 @@
 				if (iter1->modStringVersion > iter2->modStringVersion)
 				{
+#ifndef WIN32
 					rename((path)(strPathToPackages + iter2->modStringName), (path)(strTrashDir + iter2->modStringName));
+#else
+					remove((path)(strPathToPackages + iter2->modStringName));
+#endif
 					rename((path)(strPathToEUFNPackages + iter1->modStringName), (path)(strPathToPackages + iter1->modStringName));
 				}
Index: AE/Installer/trunk/source/replace_installer.bat
===================================================================
--- AE/Installer/trunk/source/replace_installer.bat	(revision 491)
+++ AE/Installer/trunk/source/replace_installer.bat	(revision 496)
@@ -1,15 +1,10 @@
-SLEEP 1
-REM %~dp is the directory of the batch file
-if exist %~dp\AEInstaller.exe (
-	if exist %~dp\..\..\..\install\AEInstaller.exe (
-		DEL %1
+PING -n 1 127.0.0.1>nul
+cd "%~dp0" /D
+if exist AEInstaller.exe (
+	if exist .\..\..\..\install\AEInstaller.exe (
+		DEL .\..\..\..\install\AEInstaller.exe 
 	)
-	else (
-		exit
-	)
-	MOVE %~dp/AEInstaller.exe  %~dp\..\..\..\install\
-	START %~dp\..\..\..\install\AEInstaller.exe
+
+	COPY AEInstaller.exe  .\..\..\..\install\
+	START ..\..\..\install\AEInstaller.exe
 )
-ELSE (
-	START %~dp\AEInstaller.exe
-)
