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

Comparing AE/Installer/trunk/source/aeinstallerapp.cpp (file contents):
Revision 358 by gumby, Fri Jun 19 22:25:08 2009 UTC vs.
Revision 385 by gumby, Mon Jul 6 00:59:40 2009 UTC

# Line 10 | Line 10
10   /////////////////////////////////////////////////////////////////////////////
11   #include "boost/thread.hpp"
12   #include <boost/thread/mutex.hpp>
13 <
13 > #include <fstream>
14   #include "boost/filesystem.hpp" // includes all needed Boost.Filesystem declarations
15   #include "boost/lexical_cast.hpp" //int -> string
16   using namespace boost::filesystem;
# Line 110 | Line 110 | bool AEInstallerApp::OnInit()
110          ////@end AEInstallerApp initialisation
111          TheWindow = mainWindow;
112          
113 + #ifndef WIN32
114 +        // test for the third-party mono framework, because without it, on Mac, we are up a creek
115 +        char monoCommand[300] = "which mono >> ";
116 +        strcat(monoCommand, system_complete("./mono_check.log").string().c_str());
117 +        system(monoCommand);
118 +        fstream file;
119 +        file.open("./mono_check.log");
120 +        string line;
121 +        int line_count = 0;
122 +        while (!file.eof())
123 +        {
124 +                line_count++;
125 +                getline(file, line);
126 +        }
127 +        file.close();
128 +        remove("./mono_check.log");
129 +        
130 +        if (line_count <= 1) // this means that "which mono" returned nothing -- abort! abort! abort!
131 +        {
132 +                wxMessageDialog* MonoDialogOfDeath = new wxMessageDialog(TheWindow, "You don't have 'mono' installed! 'mono' is a command-line tool required by the Edition. You can download it from:\nhttp://www.go-mono.com/mono-downloads/download.html (OS X 10.4+) or\nhttp://edt.oni2.net/AE/MonoFramework10.3.dmg (OS X 10.3)\n\nPlease install 'mono', then open this Installer again.",  "AE Installer Alert",  wxOK | wxICON_EXCLAMATION     , wxDefaultPosition);
133 +                MonoDialogOfDeath->ShowModal();
134 +                TheWindow->Close();
135 +                return true; // it's quittin' time, Joe
136 +        }
137 + #endif
138 +
139          //anything after this is done after the window appears...
140 <                if ( !exists("../GameDataFolder") ) {
140 >
141 >        if ( !exists("../GameDataFolder") )
142 >        {
143                  wxMessageDialog* YesNoDialog = new wxMessageDialog(TheWindow,           "You haven't globalized yet! \nYou must globalize to use the Anniversary Edition framework. \nWould you like to globalize now? (This could take a while...)\n(Selecting \"No\" will exit this program...)",  "AE Installer Alert",  wxYES_NO | wxICON_EXCLAMATION       , wxDefaultPosition);
144  
145 <                        if (YesNoDialog->ShowModal() == wxID_NO) { //if the user said no...
145 >                if (YesNoDialog->ShowModal() == wxID_NO) // if the user said no...
146                          TheWindow->Close();
147 <                }
148 <                else {
147 >                else
148 >                {
149                          TheWindow->InstallButton->Disable();
150 <                TheWindow->ReglobalizeButton->Disable();
150 >                        TheWindow->ReglobalizeButton->Disable();
151  
152   #ifdef WIN32
153 <
126 <                boost::thread thrd3(globalizeData);
153 >                        boost::thread thrd3(globalizeData);
154                  //globalizeData();
155                  //boost::thread::create_thread(&globalizeData);
156                  //       boost::thread_group Tg;
157                  // Tg.create_thread( &globalizeData(), this );
158   #else
159 <                globalizeData();
133 <                setProgressBar(1000);
134 <                setStatusArea("Done!");
159 >                        globalizeData();
160   #endif
161                  
162 <                TheWindow->InstallButton->Enable();
163 <                TheWindow->ReglobalizeButton->Enable();
162 >                        TheWindow->InstallButton->Enable();
163 >                        TheWindow->ReglobalizeButton->Enable();
164                  }
165          }
166  

Diff Legend

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