Index: AE/Installer/trunk/source/installer.cpp
===================================================================
--- AE/Installer/trunk/source/installer.cpp	(revision 552)
+++ AE/Installer/trunk/source/installer.cpp	(revision 553)
@@ -311,9 +311,4 @@
 		 run Oni before :-p */
 		string fullAEpath = escapePath(system_complete(".").parent_path().parent_path().string()); // get full path for Edition/ (Oni wants folder that *contains* the GDF)
-		//bad Iritscen, bad! fixed buffers can cause crashes.
-		/*char prefsCommand[300] = "[ -f ~/Library/Preferences/com.godgames.oni.plist ] && defaults write com.godgames.oni RetailInstallationPath -string '";
-		strcat(prefsCommand, fullAEpath.c_str());
-		strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters
-		*/
 		string prefsCommand = "[ -f ~/Library/Preferences/com.godgames.oni.plist ] && defaults write com.godgames.oni RetailInstallationPath -string '"
 			+ fullAEpath + "'";
@@ -990,11 +985,6 @@
 		}
 
-		if (updateAE->AEVersion.compare(currentAE->AEVersion) >= 1) // is the release update newer than what's installed?
-		{
-			if (!strEUFN.compare("Edition-patch")) // if update is a patch...
-			{
-				if (currentAE->AEVersion.compare(updateAE->AEVersion.substr(0, updateAE->AEVersion.length() - 1))) // ...is it for a different month?
-					return UPDATE_MNTH_REQD_ERR;
-			}
+		if (updateAE->AEVersion.compare(currentAE->AEVersion) > 0) // is the release update newer than what's installed?
+		{
 			string strNewInstallerPath = "../updates/" + strEUFN + "/install/" + strInstallerName;
 			string installerVersion = INSTALLER_VERSION;
@@ -1009,4 +999,6 @@
 				return UPDATE_SIMP_AVAIL;
 		}
+		else
+			return UPDATE_MNTH_REQD_ERR;
 	}
 	try
@@ -1495,40 +1487,37 @@
 	ProcessPackageUpdates(strPathToEUFNPackages, strPathToPackages);
 	
-	// Next, we get a list of which files and folders in the update's Globalize folder to move over; all files not starting with '.' will be moved...
-	// ...and folders which do not exist in the current AE will be created there
-	vector<string> foldersToMake, filesToMove;
-	string thePath;
+	// Next, move over files in the update's Globalize folder; subfolders which do not exist in the current AE will be created by Boost's...
+	// ...create_directories() function
+	string strPath;
+	path thePath;
 	for (recursive_directory_iterator dir_itr(strPathToEUFNPackages + strGlobalize), end_itr; dir_itr != end_itr; ++dir_itr)
 	{
-		thePath = dir_itr->path().string();
-		MakePathLocalToGlobalize(&thePath);
+		strPath = dir_itr->path().string();
+		MakePathLocalToGlobalize(&strPath);
+		thePath = (path)strPath;
 		if (is_regular_file(dir_itr->status()))
 		{
-			if (dir_itr->filename().at(0) != '.') // skip over dot-files, which are invisible in Unix
-				filesToMove.push_back(thePath);
-		}
-		else if (is_directory(dir_itr->status()))
-		{
-			if (!exists(strPathToPackages + strGlobalize + thePath))
-				foldersToMake.push_back(thePath);
-		}
-	}
-	// Sort the foldersToMake strings by length, which is a fast solution to the problem of "How do we make sure we create folder 'parent/'...
-	// ...before folder 'parent/child/'"?
-	sort(foldersToMake.begin(), foldersToMake.end(), SortBySize); // SortBySize is a custom comparison function found later in this source file
-	// First make the folders that don't exist in the current AE, so all the files have a place to go
-	for (vector<string>::iterator iter = foldersToMake.begin(); iter != foldersToMake.end(); iter++)
-	{
-		create_directory(strPathToPackages + strGlobalize + *iter);
-	}
-	for (vector<string>::iterator iter = filesToMove.begin(); iter != filesToMove.end(); iter++)
-	{
-		if (exists(strPathToPackages + strGlobalize + *iter))
+			if (thePath.filename().at(0) != '.') // skip over dot-files, which are invisible in Unix
+			{
+				if (exists(strPathToPackages + strGlobalize + strPath))
+				{
 #ifdef WIN32
-			remove((path)(strPathToPackages + strGlobalize + *iter));
+					remove((path)(strPathToPackages + strGlobalize + strPath));
 #else
-			rename((path)(strPathToPackages + strGlobalize + *iter), (path)(strTrashDir + *iter));
-#endif
-		rename((path)(strPathToEUFNPackages + strGlobalize + *iter), (path)(strPathToPackages + strGlobalize + *iter));
+					create_directories((path)(strTrashDir + thePath.parent_path().string()));
+					rename((path)(strPathToPackages + strGlobalize + strPath), (path)(strTrashDir + strPath));
+#endif
+					rename((path)(strPathToEUFNPackages + strGlobalize + strPath), (path)(strPathToPackages + strGlobalize + strPath));
+				}
+				else
+				{
+					int slashLoc = 0;
+					slashLoc = strPath.find("/", 0);
+					if (slashLoc != string::npos) // then path contains slashes, so we need to make sure its parents' paths exist before moving it
+						create_directories((path)(strPathToPackages + strGlobalize + thePath.parent_path().string()));
+					rename((path)(strPathToEUFNPackages + strGlobalize + strPath), (path)(strPathToPackages + strGlobalize + strPath));
+				}
+			}
+		}
 	}
 	
@@ -1566,5 +1555,4 @@
 		return false;
 	}
-	
 }
 
@@ -1751,21 +1739,21 @@
 	} 
 	else if(from_ph.filename() != ".svn")
-	{ 
-		path destination; 
-		if(!exists(to_ph)) 
-		{ 
-			destination=to_ph; 
-		} 
-		else 
-		{ 
-			destination=to_ph/from_ph.filename(); 
-		} 
+	{
+		path destination;
+		if(!exists(to_ph))
+		{
+			destination=to_ph;
+		}
+		else
+		{
+			destination=to_ph/from_ph.filename();
+		}
 		
-		for(directory_iterator i(from_ph); i!=directory_iterator(); ++i) 
+		for(directory_iterator i(from_ph); i!=directory_iterator(); ++i)
 		{ 
 			//the idiot who coded this in the first place (not me)
 			//forgot to make a new directory. Exception city. x_x
-			create_directory(destination); 
-			copy(*i,destination/i->filename()); 
+			create_directory(destination);
+			copy(*i, destination/i->filename());
 		} 
 	} 
