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

Comparing AE/Installer/trunk/source/installer.cpp (file contents):
Revision 507 by gumby, Sat Apr 24 17:41:46 2010 UTC vs.
Revision 508 by gumby, Sat Apr 24 17:52:34 2010 UTC

# Line 1004 | Line 1004 | int GetUpdateStatus(Install_info_cfg *cu
1004                                          }
1005                                  }
1006                          }
1007                        else
1008                        {
1009                                file.close();
1010                                continue;
1011                        }
1012                        file.close();
1013                                                
1014                        file.open( ("packages" + install_iter->path().filename() + "/Mod_Info.cfg").c_str());
1015                        if (!file.fail())
1016                        {
1017                                ModPackage installedPackage = fileToModPackage(file, install_iter->path().filename());
1018                        }
1019                        else
1020                        {
1021                                file.close();
1022                                return UPDATE_THIRD_PARTY;
1023                        }
1024                        file.close();
1025                        if(((string)INSTALLER_VERSION).compare(updatePackage.installerVersion) < 1 && updatePackage.modStringVersion > installedPackage.modStringVersion) {
1026                                return UPDATE_THIRD_PARTY;
1027                        }
1007                  }
1008          }
1009          catch (exception & ex) {
# Line 1044 | Line 1023 | bool ReadInstallInfoCfg(fstream *fileHan
1023          string strDaodanVersion = "Daodan_Version";
1024          string strOniSplitVersion = "OniSplit_Version";
1025          string strGUIWinVersion = "GUI_Win_Version";
1026 <        string strGUIMacVersion = "GUI_Mac_Version";
1026 >        string strGUIMacVersion = "GUI_Mac_Version";
1027          string strReglobalize = "Reglobalize";
1028          string strDeleteList = "Delete_List";
1029          string strArrow = "->";
# Line 1286 | Line 1265 | bool ProcessInstallerUpdate(Install_info
1265          return true; // returning 'true' tells the Installer to quit itself ASAP so it can be replaced by the process that is now running
1266   }
1267  
1289
1290 void CrawlPackages(string pathToUpdate, string strPathToPackages) {
1291        try{
1292                directory_iterator end;
1293                for ( directory_iterator update_iter( pathToUpdate );
1294                        update_iter != end;
1295                        ++update_iter )
1296                {
1297
1298                        ModPackage installedPackage, updatePackage;
1299                        string updateStr = update_iter->path().string() + "/Mod_Info.cfg";
1300                        if ( !boost::iequals(update_iter->path().filename(),"Edition")
1301                                && !boost::iequals(update_iter->path().filename(),"Edition-patch")
1302                                && is_directory( update_iter->path() )
1303                                && exists( update_iter->path().string() + "/Mod_Info.cfg" ) )
1304                        {
1305                                bool update = 0;
1306                                fstream file;
1307                                file.open( (update_iter->path().string() + "/Mod_Info.cfg").c_str());  
1308                                if (!file.fail())
1309                                {
1310                                        updatePackage = fileToModPackage(file, update_iter->path().filename());
1311                                }
1312                                else
1313                                {
1314                                        file.close();
1315                                        continue;
1316                                }
1317                                file.close();
1318                                file.clear();
1319                                if(exists(strPathToPackages + "/" + update_iter->path().filename() + "/Mod_Info.cfg"))
1320                                {
1321                                file.open((strPathToPackages + "/" + update_iter->path().filename() + "/Mod_Info.cfg").c_str());
1322                                if (!file.fail())
1323                                {
1324                                        installedPackage = fileToModPackage(file, update_iter->path().filename());
1325                                        file.close();
1326                                        if(updatePackage.modStringVersion > installedPackage.modStringVersion) {
1327                                                update = 1;
1328                                        }
1329                                }
1330                                else
1331                                {
1332                                        file.close();
1333                                        update = 1;
1334                                }
1335                                file.close();
1336                                }
1337                                else update = 1;
1338                                if(update) {
1339                                        if(exists((path)(strPathToPackages +  "/" + updatePackage.modStringName)))
1340                                                remove_all((path)(strPathToPackages +  "/" + updatePackage.modStringName));                    
1341                                        rename((path)(pathToUpdate + "/" + updatePackage.modStringName), (path)(strPathToPackages + "/" + updatePackage.modStringName));
1342
1343                                }
1344                        }
1345                }
1346        }
1347        catch (exception & ex) {
1348                //      ex.what();
1349                setStatusArea("Warning, handled exception: " + (string)ex.what());
1350        }
1351 }
1352
1353
1354 bool ProcessThirdPartyUpdates() {
1355 CrawlPackages( "../updates",  "./packages");
1356 return true;
1357        //      globalPackages = getPackages();
1358 //      refreshMods(globalInstalledMods);
1359 }
1360
1361
1268   bool ProcessAEUpdate(Install_info_cfg *currentAE, Install_info_cfg *updateAE, bool *installerJustUpdated)
1269   {
1270          fstream file;

Diff Legend

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