Changeset 393


Ignore:
Timestamp:
Jul 6, 2009, 5:39:35 PM (15 years ago)
Author:
iritscen
Message:

Implemented escapePath() to fix path bug on Mac side.

Location:
AE/Installer/trunk/source
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • AE/Installer/trunk/source/aeinstallerapp.cpp

    r385 r393  
    114114        // test for the third-party mono framework, because without it, on Mac, we are up a creek
    115115        char monoCommand[300] = "which mono >> ";
    116         strcat(monoCommand, system_complete("./mono_check.log").string().c_str());
     116        strcat(monoCommand, escapePath(system_complete("mono_check.log").string()).c_str());
    117117        system(monoCommand);
    118118        fstream file;
    119         file.open("./mono_check.log");
     119        file.open("mono_check.log");
    120120        string line;
    121121        int line_count = 0;
     
    126126        }
    127127        file.close();
    128         remove("./mono_check.log");
     128        remove("mono_check.log");
    129129       
    130130        if (line_count <= 1) // this means that "which mono" returned nothing -- abort! abort! abort!
  • AE/Installer/trunk/source/aeinstallerapp.h

    r382 r393  
    2323////@end includes
    2424
     25string escapePath(string input);
    2526
    2627/*!
  • AE/Installer/trunk/source/main_window.cpp

    r392 r393  
    6464        string escape_me = "& ;()|<>\"'\\#*?$";
    6565        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 += '\\';
    6767                output += input[i];
    6868        }
     
    355355                   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,
    356356                   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
    358358                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)
    360360                strcat(prefsCommand, "'"); // path string is enclosed in single quotes to avoid the need to escape UNIX-unfriendly characters
    361361                system(prefsCommand);
Note: See TracChangeset for help on using the changeset viewer.