--- AE/Installer/trunk/source/main_window.cpp 2009/07/08 17:20:07 410 +++ AE/Installer/trunk/source/main_window.cpp 2009/07/15 21:16:14 423 @@ -362,9 +362,9 @@ int globalizeData(void) copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder"); setProgressBar( 1000 ); - if(!exists("../persist.dat")) + if(exists("../../persist.dat")) if(!exists("../persist.dat")) copy("../../persist.dat",".."); - if(!exists("../key_config.txt")) + if(exists("../../key_config.txt"))if(!exists("../key_config.txt")) copy("../../key_config.txt",".."); #ifndef WIN32 @@ -545,29 +545,34 @@ ModPackage fileToModPackage(fstream &fil } void recompileAll(vector installedMods) -{ +{try { busy = 1; using namespace boost::gregorian; using namespace boost::posix_time; using boost::lexical_cast; using boost::bad_lexical_cast; - - setStatusArea("Importing levels..."); - //setStatusArea("Recompiling Data..."); - path vanilla_dir = "./VanillaDats/"; + path vanilla_dir = "./VanillaDats/"; string importCommand = ""; char statusString[128]; int numberOfDats = 0; int j = 1; string datString; + + + setStatusArea("Importing levels..."); + //setStatusArea("Recompiling Data..."); + std::stringstream out; ptime start_time(second_clock::local_time()); clearOldDats(); - remove("Install.log"); + + if(exists("Install.log")) remove("Install.log"); ofstream logfile("Install.log"); logfile << "Mod Installation started " << to_simple_string(start_time) << endl; logfile.close(); + + if(splitInstances == SPLIT){ recursive_directory_iterator end_iter; @@ -581,13 +586,19 @@ void recompileAll(vector install numberOfDats++; } } - catch(exception ex) { + catch(exception & ex) { + remove("Install.log"); + ofstream logfile("Install.log"); + + logfile << "Warning, exception " << ex.what() << "!"; + setStatusArea("Warning, exception " + (string)ex.what() + "!"); + logfile.close(); } } try { //recursive_directory_iterator end_iter; - + out << numberOfDats; datString = out.str(); @@ -721,9 +732,21 @@ void recompileAll(vector install Sleep(1000); setProgressBar(0); - busy = 0; + +} + catch(exception & ex) { + remove("Install.log"); + ofstream logfile("Install.log"); + + + logfile << "Warning, exception " << ex.what() << "!"; + setStatusArea("Warning, exception " + (string)ex.what() + "!"); + logfile.close(); + } + busy = 0; } + void writeInstalledMods(vector installedMods) { @@ -1391,19 +1414,29 @@ struct recompile TheInstallButton->Disable(); recompileAll(thePackages); TheInstallButton->Enable(); + } vector thePackages; }; +void globalize2(void) { + TheInstallButton->Disable(); + globalizeData(); + TheInstallButton->Enable(); +} + + + void MainWindow::OnInstallButtonClick( wxCommandEvent& event ) { vector localPackages; - localPackages.push_back("Globalize"); + localPackages.push_back("00000Globalize"); for(int i = 0; i < globalPackages.size(); i++) if(Mods_CheckboxList->IsChecked(i)) localPackages.push_back( globalPackages[i].modStringName ); if ( !localPackages.empty() ) { - + sort(localPackages.begin(), localPackages.end()); + localPackages[0] = "Globalize"; //MainWindow::MainWindow().Hide(); // boost::thread thrd2(recompileAll(localPackages) ); //MainWindow::MainWindow().Show();