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 392 by gumby, Mon Jul 6 14:44:10 2009 UTC vs.
Revision 393 by iritscen, Mon Jul 6 15:39:35 2009 UTC

# Line 63 | Line 63 | string escapePath(string input) {
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 += '//';
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;
# Line 354 | Line 354 | int globalizeData(void)
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                  

Diff Legend

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