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 423 by gumby, Wed Jul 15 21:16:14 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 + #ifdef WIN32
114 +         HKEY hKey;
115 +         if(!RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\.NETFramework\\policy\\v2.0", 0L, KEY_READ , &hKey) == ERROR_SUCCESS) {
116 +                 wxMessageDialog* MonoDialogOfDeath = new wxMessageDialog(TheWindow, "You don't have .NET 2.0 installed! .NET is a framework required by the Edition. You can download it from:\nhttp://gumby.oni2.net/dotnet\nPlease install .NET 2.0, then open this Installer again. \n\nWould you like to open the download webpage?",  "AE Installer Alert",  wxYES_NO | wxICON_EXCLAMATION        , wxDefaultPosition);
117 +                 if(MonoDialogOfDeath->ShowModal() == wxID_YES) {
118 +                        system("start http://www.microsoft.com/downloads/details.aspx?familyid=0856eacb-4362-4b0d-8edd-aab15c5e04f5");
119 +                 }
120 +                RegCloseKey(hKey);
121 +                TheWindow->Close();
122 +         }
123 + #else
124 +        // test for the third-party mono framework, because without it, on Mac, we are up a creek
125 +        char monoCommand[300] = "which mono >> ";
126 +        strcat(monoCommand, escapePath(system_complete("mono_check.log").string()).c_str());
127 +        system(monoCommand);
128 +        fstream file;
129 +        file.open("mono_check.log");
130 +        string line;
131 +        int line_count = 0;
132 +        while (!file.eof())
133 +        {
134 +                line_count++;
135 +                getline(file, line);
136 +        }
137 +        file.close();
138 +        remove("mono_check.log");
139 +        
140 +        if (line_count <= 1) // this means that "which mono" returned nothing -- abort! abort! abort!
141 +        {
142 +                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);
143 +                MonoDialogOfDeath->ShowModal();
144 +                TheWindow->Close();
145 +                return true; // it's quittin' time, Joe
146 +        }
147 + #endif
148 +
149          //anything after this is done after the window appears...
150 <                if ( !exists("../GameDataFolder") ) {
150 >
151 >        if ( !exists("../GameDataFolder") )
152 >        {
153                  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);
154  
155 <                        if (YesNoDialog->ShowModal() == wxID_NO) { //if the user said no...
155 >                if (YesNoDialog->ShowModal() == wxID_NO) // if the user said no...
156                          TheWindow->Close();
157 <                }
158 <                else {
121 <                        TheWindow->InstallButton->Disable();
122 <                TheWindow->ReglobalizeButton->Disable();
157 >                else
158 >                {
159  
124 #ifdef WIN32
160  
161 <                boost::thread thrd3(globalizeData);
161 > #ifdef WIN32
162 >                        boost::thread thrd3(globalize2);
163                  //globalizeData();
164                  //boost::thread::create_thread(&globalizeData);
165                  //       boost::thread_group Tg;
166                  // Tg.create_thread( &globalizeData(), this );
167   #else
168 <                globalizeData();
169 <                setProgressBar(1000);
170 <                setStatusArea("Done!");
168 >                                                TheWindow->InstallButton->Disable();
169 >                        TheWindow->ReglobalizeButton->Disable();
170 >                        globalizeData();
171 >                                                TheWindow->InstallButton->Enable();
172 >                        TheWindow->ReglobalizeButton->Enable();
173   #endif
174                  
175 <                TheWindow->InstallButton->Enable();
138 <                TheWindow->ReglobalizeButton->Enable();
175 >
176                  }
177          }
178  

Diff Legend

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