Index: AE/Installer/trunk/source/installer.cpp
===================================================================
--- AE/Installer/trunk/source/installer.cpp	(revision 508)
+++ AE/Installer/trunk/source/installer.cpp	(revision 509)
@@ -976,8 +976,10 @@
 				if (is_directory(install_iter->path()) && exists(install_iter->path().string() + "/Mod_Info.cfg"))
 				{
+					string blah =install_iter->path().string() + "/Mod_Info.cfg";
+					string blah2 = "packages/" + install_iter->path().filename() + "/Mod_Info.cfg";
 					fstream file;
 					file.open((install_iter->path().string() + "/Mod_Info.cfg").c_str());
 					if (!file.fail())
-						ModPackage updatePackage = fileToModPackage(file, install_iter->path().filename());
+						updatePackage = fileToModPackage(file, install_iter->path().filename());
 					else
 					{
@@ -985,10 +987,11 @@
 						continue;
 					}
-					if (exists("packages" + install_iter->path().filename() + "/Mod_Info.cfg"))
+					if (exists("packages/" + install_iter->path().filename() + "/Mod_Info.cfg"))
 					{
 						file.close();
-						file.open(("packages" + install_iter->path().filename() + "/Mod_Info.cfg").c_str());
+						file.clear();
+						file.open(("packages/" + install_iter->path().filename() + "/Mod_Info.cfg").c_str());
 						if (!file.fail())
-							ModPackage installedPackage = fileToModPackage(file, install_iter->path().filename());
+							installedPackage = fileToModPackage(file, install_iter->path().filename());
 						file.close();
 						if (updatePackage.modStringVersion > installedPackage.modStringVersion)
@@ -1490,5 +1493,5 @@
 	return true;
 }
-
+extern MainWindow* TheWindow;
 void ProcessPackageUpdates(string pathToUpdate, string strPathToPackages)
 {
@@ -1541,30 +1544,29 @@
 					{
 						installedPackage = fileToModPackage(file, updtFolder);
-						file.close();
-						if (updatePackage.modStringVersion > installedPackage.modStringVersion)
-						{
-							if (updatePackage.installerVersion <= INSTALLER_VERSION)
+					}
+					file.close();
+				}
+				file.close();
+				if (updatePackage.modStringVersion > installedPackage.modStringVersion)
+				{
+					if (updatePackage.installerVersion <= INSTALLER_VERSION)
+					{
+						if(exists(strPathToPackages +  "/" + updatePackage.modStringName)) {
+#ifdef WIN32
+							remove_all((path)(strPathToPackages +  "/" + updatePackage.modStringName));
+#else
+							if (needNewTrashDir)
 							{
-#ifdef WIN32
-								remove_all((path)(strPathToPackages +  "/" + installedPackage.modStringName));
-#else
-								if (needNewTrashDir)
-								{
-									strTrashDir = strTrashDir + "Old_packages_" + boost::lexical_cast<string>(tmStartTime.tm_hour) + "-" +
-												  boost::lexical_cast<string>(tmStartTime.tm_min) + "-" + boost::lexical_cast<string>(tmStartTime.tm_sec) + "/";
-									create_directory(strTrashDir);
-									needNewTrashDir = false;
-								}
-								rename((path)(strPathToPackages +  "/" + installedPackage.modStringName), (path)(strTrashDir + installedPackage.modStringName));
+								strTrashDir = strTrashDir + "Old_packages_" + boost::lexical_cast<string>(tmStartTime.tm_hour) + "-" +
+									boost::lexical_cast<string>(tmStartTime.tm_min) + "-" + boost::lexical_cast<string>(tmStartTime.tm_sec) + "/";
+								create_directory(strTrashDir);
+								needNewTrashDir = false;
+							}
+							rename((path)(strPathToPackages +  "/" + updatePackage.modStringName), (path)(strTrashDir + updatePackage.modStringName));
 #endif
-								rename((path)(pathToUpdate + "/" + updatePackage.modStringName), (path)(strPathToPackages + "/" + updatePackage.modStringName));
-							}
 						}
+						rename((path)(pathToUpdate + "/" + updatePackage.modStringName), (path)(strPathToPackages + "/" + updatePackage.modStringName));
 					}
-					else
-						file.close();
-				}
-				file.close();
-				file.clear();
+				}
 			}
 		}
@@ -1574,4 +1576,6 @@
 		setStatusArea("Warning, handled exception: " + (string)ex.what());
 	}
+	wxCommandEvent e;
+	TheWindow->OnRefreshButtonClick( e );
 }
 
