| 647 |
|
vector<string> skippedfolders; |
| 648 |
|
|
| 649 |
|
ofstream BSLlog("BSL.log"); |
| 650 |
+ |
if(exists("../GameDataFolder/BSLBackup/")) { |
| 651 |
+ |
remove_all("../GameDataFolder/BSLBackup/"); |
| 652 |
+ |
} |
| 653 |
+ |
else { |
| 654 |
+ |
create_directory("../GameDataFolder/BSLBackup/"); |
| 655 |
+ |
} |
| 656 |
+ |
copy("../GameDataFolder/IGMD/", "../GameDataFolder/BSLBackup/"); |
| 657 |
|
for ( directory_iterator dir_itr( "../GameDataFolder/IGMD/" ), end_itr; |
| 658 |
|
dir_itr != end_itr; |
| 659 |
|
++dir_itr ) { |
| 666 |
|
for (int i = installedMods.size() - 1; i >= 0; i--) { //Iterates through the installed mods (backwards :P) |
| 667 |
|
for (unsigned int j = 0; j < globalPackages.size(); ++j) { //looking in the global packages |
| 668 |
|
if (globalPackages[j].modStringName == installedMods[i]) { //for a mod that has BSL in it |
| 669 |
< |
if(globalPackages[j].hasBSL)) break; //skip non-BSL |
| 669 |
> |
if(globalPackages[j].hasBSL) break; //skip non-BSL |
| 670 |
|
if( exists( "packages/" + globalPackages[j].modStringName + "/BSL/" ) ) { |
| 671 |
|
copyBSL("packages/" + globalPackages[j].modStringName + "/BSL", BSLfolders, globalPackages[j] ); |
| 672 |
|
BSLlog << "Copied " << globalPackages[j].modStringName << "!\n"; |
| 735 |
|
if ( is_directory( dir_itr->path() ) && dir_itr->path().string() != ".svn" ) { |
| 736 |
|
BSLlog << "Testing " << dir_itr->path().string() << " HasBSL: " << pkg.hasBSL << " HasAddon: " << pkg.hasAddon << "\n"; |
| 737 |
|
int skip_folder = 0; |
| 738 |
< |
if(!pkg.HasAddon) { |
| 738 |
> |
if(!pkg.hasAddon) { |
| 739 |
|
for(unsigned int k = 0; k < BSLfolders.size(); k++) {//iterate through already found BSL folders |
| 740 |
|
BSLlog << "testing " << dir_itr->path().filename() << " vs " << BSLfolders[k] << "\n"; |
| 741 |
|
if(dir_itr->path().filename() == BSLfolders[k]) { |
| 1384 |
|
// Special code to replace our special files -- the Oni app, OniSplit, the Daodan DLL, and the GUI for OniSplit |
| 1385 |
|
if (exists(strPathToEUFN + strOniApp)) |
| 1386 |
|
{ |
| 1387 |
< |
if (exists(strOniApp)) |
| 1387 |
> |
if (exists("../" + strOniApp)) |
| 1388 |
|
#ifdef WIN32 |
| 1389 |
< |
remove((path)strOniApp); |
| 1389 |
> |
remove((path)("../" + strOniApp)); |
| 1390 |
|
#else |
| 1391 |
< |
rename((path)strOniApp, (path)(strTrashDir + strOniApp)); |
| 1391 |
> |
rename((path)("../" + strOniApp), (path)(strTrashDir + strOniApp)); |
| 1392 |
|
#endif |
| 1393 |
< |
rename((path)(strPathToEUFN + strOniApp), (path)strOniApp); |
| 1393 |
> |
rename((path)(strPathToEUFN + strOniApp), (path)("../" + strOniApp)); |
| 1394 |
|
} |
| 1395 |
|
if (updateAE->OniSplitVersion.compare(currentAE->OniSplitVersion) >= 1) |
| 1396 |
|
{ |
| 1513 |
|
|
| 1514 |
|
// Clean up after ourselves, trashing any packages or programs in the update package that are not newer than the current AE |
| 1515 |
|
#ifdef WIN32 |
| 1516 |
< |
remove((path)strPathToEUFN); |
| 1516 |
> |
remove_all((path)strPathToEUFN); |
| 1517 |
|
#else |
| 1518 |
|
create_directory(strTrashDir + "Unneeded update files"); |
| 1519 |
|
rename((path)strPathToEUFN, (path)(strTrashDir + "Unneeded update files/" + strEUFN)); |