ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/AE/Installer/trunk/source/main_window.cpp
(Generate patch)

Comparing AE/Installer/trunk/source/main_window.cpp (file contents):
Revision 385 by gumby, Mon Jul 6 00:59:40 2009 UTC vs.
Revision 393 by iritscen, Mon Jul 6 15:39:35 2009 UTC

# Line 58 | Line 58 | using namespace std;
58   #include "boost/date_time/date_parsing.hpp"
59   #include "boost/date_time/posix_time/posix_time.hpp"
60  
61 + string escapePath(string input) {
62 +        
63 +        string output;
64 +        string escape_me = "& ;()|<>\"'\\#*?$";
65 +        for(int i = 0; i < input.size(); i++)  {
66 +                for(int j = 0; j < escape_me.size(); j++) if (input[i] == escape_me[j]) output += '\\';
67 +                output += input[i];
68 +        }
69 +        return output;
70 + }
71 +
72   int globalizeData(void)
73   {
74          busy = 1;
# Line 148 | Line 159 | int globalizeData(void)
159  
160                  if (exists("packages/VanillaDats")) remove_all("packages/VanillaDats");
161                  create_directory( "packages/VanillaDats" );
151
162                  create_directory( "packages/VanillaDats/level0_Final/" );
163                  //blah blah finish this.
164                  //logfile <<  "packages/VanillaDats/level0_Final/ created";
# Line 261 | Line 271 | int globalizeData(void)
271                                                                  if(!exists( Archive / dir_itr->filename())) rename(dir_itr->path(), Archive / dir_itr->filename());
272                                                                  else remove(dir_itr->path());
273                                                  }
274 +                                                else if (dir_itr->path().filename().substr(0,4) == "ONWC") { //fix for buggy ONWC overriding
275 +                                                                cout <<dir_itr->path().filename() << "\n";
276 +
277 +                                                                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());
278 +                                                                else remove(dir_itr->path());
279 +                                                }
280                                                  if (exists(dir_itr->path())) {
281  
282                                                  }
# Line 330 | Line 346 | int globalizeData(void)
346                  setProgressBar( 1000 );
347                  
348                  // 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/
349 <                
350 <                // CIP:then copy persist.dat and keyconfig.txt into edition/ as well
351 <                
349 >                // or we could just include it in the zip in the proper place already.
350 >
351 >                copy("../../persist.dat","../persist.dat");
352 >                copy("../../keyconfig.txt","../keyconfig.txt");
353   #ifndef WIN32
354                  /* 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).
355                     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,
356                     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 */
357 <                path fullAEpath = system_complete("."); // get full path for Installer
357 >                string fullAEpath = escapePath(system_complete(".").parent_path().parent_path().string()); // get full path for Installer
358                  char prefsCommand[300] = "defaults write com.godgames.oni RetailInstallationPath -string '";
359 <                strcat(prefsCommand, fullAEpath.parent_path().parent_path().string().c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF)
359 >                strcat(prefsCommand, fullAEpath.c_str()); // get path of edition/ folder (Oni wants the folder that *contains* the GDF)
360                  strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters
361                  system(prefsCommand);
362                  
363   #endif
364                  
365 +                
366                  setStatusArea((string)"Done! Now select your mod packages and click install.");
367                  //      while(1) Sleep(-1);
368  
# Line 974 | Line 992 | void MainWindow::CreateControls()
992      itemMenu42->Append(wxID_OPTIONS, _("Show Advanced Options..."), wxEmptyString, wxITEM_CHECK);
993      menuBar->Append(itemMenu42, _("Options"));
994      wxMenu* itemMenu44 = new wxMenu;
995 <    itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
996 <    menuBar->Append(itemMenu44, _("Help"));
995 > #ifdef WIN32
996 >        itemMenu44->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
997 >        menuBar->Append(itemMenu44, _("Help"));
998 > #else
999 >        itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1000 > #endif  
1001 >
1002      itemFrame1->SetMenuBar(menuBar);
1003  
1004      wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
# Line 1116 | Line 1139 | void MainWindow::CreateControls()
1139                  strImportOption = "-import:nosep";
1140                  splitInstances = SPLIT;
1141          }
1142 <
1142 >        
1143          globalPackages = getPackages();
1144          globalInstalledMods = getInstallString();
1145          for (int i = 0; i < globalPackages.size(); i++) {
# Line 1128 | Line 1151 | void MainWindow::CreateControls()
1151          TheInstallButton = InstallButton;
1152          TheProgressBar = ProgressBar;
1153          OptionsPanel->Hide();
1154 +        
1155 + //#ifndef WIN32
1156 + //      itemMenu37->Append(wxID_ABOUT, _("About"), wxEmptyString, wxITEM_NORMAL);
1157 +        
1158 + //#endif
1159 +        
1160          if(splitInstances == SPLIT) SeperatedRadio->SetValue(true);
1161          else CompleteRadio->SetValue(true);
1133
1134
1135
1162          if(strImportOption == "-import:nosep") NoSepRadio->SetValue(true);
1163          else SepRadio->SetValue(true);
1164  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)