Changeset 509
- Timestamp:
- Apr 24, 2010, 9:19:14 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/Installer/trunk/source/installer.cpp
r508 r509 976 976 if (is_directory(install_iter->path()) && exists(install_iter->path().string() + "/Mod_Info.cfg")) 977 977 { 978 string blah =install_iter->path().string() + "/Mod_Info.cfg"; 979 string blah2 = "packages/" + install_iter->path().filename() + "/Mod_Info.cfg"; 978 980 fstream file; 979 981 file.open((install_iter->path().string() + "/Mod_Info.cfg").c_str()); 980 982 if (!file.fail()) 981 ModPackageupdatePackage = fileToModPackage(file, install_iter->path().filename());983 updatePackage = fileToModPackage(file, install_iter->path().filename()); 982 984 else 983 985 { … … 985 987 continue; 986 988 } 987 if (exists("packages " + install_iter->path().filename() + "/Mod_Info.cfg"))989 if (exists("packages/" + install_iter->path().filename() + "/Mod_Info.cfg")) 988 990 { 989 991 file.close(); 990 file.open(("packages" + install_iter->path().filename() + "/Mod_Info.cfg").c_str()); 992 file.clear(); 993 file.open(("packages/" + install_iter->path().filename() + "/Mod_Info.cfg").c_str()); 991 994 if (!file.fail()) 992 ModPackageinstalledPackage = fileToModPackage(file, install_iter->path().filename());995 installedPackage = fileToModPackage(file, install_iter->path().filename()); 993 996 file.close(); 994 997 if (updatePackage.modStringVersion > installedPackage.modStringVersion) … … 1490 1493 return true; 1491 1494 } 1492 1495 extern MainWindow* TheWindow; 1493 1496 void ProcessPackageUpdates(string pathToUpdate, string strPathToPackages) 1494 1497 { … … 1541 1544 { 1542 1545 installedPackage = fileToModPackage(file, updtFolder); 1543 file.close(); 1544 if (updatePackage.modStringVersion > installedPackage.modStringVersion) 1545 { 1546 if (updatePackage.installerVersion <= INSTALLER_VERSION) 1546 } 1547 file.close(); 1548 } 1549 file.close(); 1550 if (updatePackage.modStringVersion > installedPackage.modStringVersion) 1551 { 1552 if (updatePackage.installerVersion <= INSTALLER_VERSION) 1553 { 1554 if(exists(strPathToPackages + "/" + updatePackage.modStringName)) { 1555 #ifdef WIN32 1556 remove_all((path)(strPathToPackages + "/" + updatePackage.modStringName)); 1557 #else 1558 if (needNewTrashDir) 1547 1559 { 1548 #ifdef WIN32 1549 remove_all((path)(strPathToPackages + "/" + installedPackage.modStringName)); 1550 #else 1551 if (needNewTrashDir) 1552 { 1553 strTrashDir = strTrashDir + "Old_packages_" + boost::lexical_cast<string>(tmStartTime.tm_hour) + "-" + 1554 boost::lexical_cast<string>(tmStartTime.tm_min) + "-" + boost::lexical_cast<string>(tmStartTime.tm_sec) + "/"; 1555 create_directory(strTrashDir); 1556 needNewTrashDir = false; 1557 } 1558 rename((path)(strPathToPackages + "/" + installedPackage.modStringName), (path)(strTrashDir + installedPackage.modStringName)); 1560 strTrashDir = strTrashDir + "Old_packages_" + boost::lexical_cast<string>(tmStartTime.tm_hour) + "-" + 1561 boost::lexical_cast<string>(tmStartTime.tm_min) + "-" + boost::lexical_cast<string>(tmStartTime.tm_sec) + "/"; 1562 create_directory(strTrashDir); 1563 needNewTrashDir = false; 1564 } 1565 rename((path)(strPathToPackages + "/" + updatePackage.modStringName), (path)(strTrashDir + updatePackage.modStringName)); 1559 1566 #endif 1560 rename((path)(pathToUpdate + "/" + updatePackage.modStringName), (path)(strPathToPackages + "/" + updatePackage.modStringName));1561 }1562 1567 } 1568 rename((path)(pathToUpdate + "/" + updatePackage.modStringName), (path)(strPathToPackages + "/" + updatePackage.modStringName)); 1563 1569 } 1564 else 1565 file.close(); 1566 } 1567 file.close(); 1568 file.clear(); 1570 } 1569 1571 } 1570 1572 } … … 1574 1576 setStatusArea("Warning, handled exception: " + (string)ex.what()); 1575 1577 } 1578 wxCommandEvent e; 1579 TheWindow->OnRefreshButtonClick( e ); 1576 1580 } 1577 1581
Note:
See TracChangeset
for help on using the changeset viewer.