--- AE/Installer/trunk/source/main_window.cpp 2009/07/06 17:53:15 394 +++ AE/Installer/trunk/source/main_window.cpp 2009/07/06 22:56:35 399 @@ -286,14 +286,14 @@ int globalizeData(void) else if (dir_itr->path().filename().substr(0,4) == "ONWC") { //fix for buggy ONWC overriding cout <path().filename() << "\n"; - if(!exists( "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final/" + dir_itr->filename())) rename(dir_itr->path(), "packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final/" + dir_itr->filename()); + if(!exists( "packages/VanillaDats/level0_Final/level0_Final/" + dir_itr->filename())) rename(dir_itr->path(), "packages/VanillaDats/level0_Final/level0_Final/" + dir_itr->filename()); else remove(dir_itr->path()); } if (exists(dir_itr->path())) { } else { - //logfile << "\tMoved file: " << dir_itr->path().filename() << "\n"; + logfile << "\tMoved file: " << dir_itr->path().filename() << "\n"; } } @@ -318,7 +318,7 @@ int globalizeData(void) logfile << (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level" + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log").c_str() << '\n'; string sys_str = (strOniSplit + " " + strImportOption + " ../GameDataFolder/level" + levels[i] + "_Final packages/VanillaDats/level" + levels[i] + "_Final/level" - + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize2.log"); + + levels[i] + "_Final/level" + levels[i] + "_Final.oni >> Globalize.log"); system(sys_str.c_str() ); setProgressBar( (int)(1000 * (float)(parts_done) / (float)(total_steps) )); parts_done++; @@ -356,18 +356,16 @@ int globalizeData(void) create_directory((path)"../GameDataFolder/IGMD"); copy((path)"packages/VanillaBSL/IGMD", (path)"../GameDataFolder"); setProgressBar( 1000 ); - - // CIP:last of all, set up the edition folder as a playable Oni installation by placing the latest application (+ Daodan DLL on Windows) in edition/ - // or we could just include it in the zip in the proper place already. - copy("../../persist.dat","../persist.dat"); - copy("../../keyconfig.txt","../keyconfig.txt"); + copy("../../persist.dat",".."); + copy("../../key_config.txt",".."); + #ifndef WIN32 /* On Mac only, set the current GDF to the AE GDF by writing to Oni's global preferences file (thankfully a standard OS X ".plist" XML file). - If there are no Oni prefs (only possible if Oni has not been run even once), then the above line will fail silently, no harm done, - and when the user does run Oni for the first time, using the copy of the app in the AE GDF, Oni will set the prefs to use that GDF at that point */ - string fullAEpath = escapePath(system_complete(".").parent_path().parent_path().string()); // get full path for Installer - char prefsCommand[300] = "defaults write com.godgames.oni RetailInstallationPath -string '"; + Tests for presence of prefs with [ -f ] before doing anything so it doesn't create a partial prefs file -- just in case user has never + run Oni before :-p */ + string fullAEpath = escapePath(system_complete(".").parent_path().parent_path().string()); // get full path for edition/ + char prefsCommand[300] = "[ -f ~/Library/Preferences/com.godgames.oni.plist ] && defaults write com.godgames.oni RetailInstallationPath -string '"; strcat(prefsCommand, fullAEpath.c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF) strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters system(prefsCommand); @@ -379,7 +377,7 @@ int globalizeData(void) // while(1) Sleep(-1); } - catch (exception ex) { + catch (exception & ex) { setStatusArea("Warning, handled exception: " + (string)ex.what()); }