--- AE/Installer/trunk/source/aeinstallerapp.cpp 2009/12/30 01:51:38 487 +++ AE/Installer/trunk/source/aeinstallerapp.cpp 2010/05/29 02:49:13 554 @@ -18,6 +18,8 @@ ////@begin includes ////@end includes +extern int updateStatus; +extern bool installerJustUpdated; Install_info_cfg currentAE, updateAE; MainWindow* TheWindow; @@ -110,13 +112,11 @@ bool AEInstallerApp::OnInit() return true; } - bool installerJustUpdated = false; - int updateStatus = GetUpdateStatus(¤tAE, &updateAE, &installerJustUpdated); - if (updateStatus) // otherwise there's no update + if (updateStatus) // updateStatus was set when MainWindow::CreateControls() was called during initialization of the window { - string updateMsg = "An update for the Anniversary Edition is available.\n"; // for some reason we can't set the initial value while using the '+' operator... - updateMsg = updateMsg + "Do you wish to update to Edition version " + updateAE.AEVersion + "?\n" + - "(Current version is " + currentAE.AEVersion + ")\n"; // ...so tack the rest on in a second command + string updateMsg = "An update for the Anniversary Edition is available.\n" + "Do you wish to update to Edition version " + updateAE.AEVersion + "?\n" + "(Current version is " + currentAE.AEVersion + ")\n"; // ...so we tack the rest on in a second command wxMessageDialog* updateNotification; switch (updateStatus) // for the meanings of these return values, see the comments preceding installer.cpp's GetUpdateStatus() @@ -130,7 +130,7 @@ bool AEInstallerApp::OnInit() break; case UPDATE_MNTH_REQD_ERR: updateMsg = "There is a patch in the updates/ folder, but it patches the\n"; - updateMsg = updateMsg + updateAE.AEVersion.substr(0, updateAE.AEVersion.length() - 1) + " release; it cannot update this version of the Edition."; + updateMsg = updateMsg + updateAE.AEVersion + " release; it cannot update this version of the Edition."; updateNotification = new wxMessageDialog(TheWindow, updateMsg.c_str(), "AE Installer Alert", wxOK | wxICON_EXCLAMATION, wxDefaultPosition); updateNotification->ShowModal(); break; @@ -139,6 +139,15 @@ bool AEInstallerApp::OnInit() if (updateNotification->ShowModal() == wxID_YES) ProcessAEUpdate(¤tAE, &updateAE, &installerJustUpdated); break; + case UPDATE_PKG_AVAIL: // there's an update with no globalization or Installer strings attached + updateMsg = (string)"One or individual package updates for the Anniversary Edition is available.\n\n" + + (string)"Please note that the AE team assumes no responsibility for the content of third party mods " + + (string)"nor effects that a third party mod may have on your install.\n\n" + + (string)"Do you wish to install these update(s)?"; + updateNotification = new wxMessageDialog(TheWindow, updateMsg.c_str(), "AE Installer Alert", wxYES_NO | wxICON_EXCLAMATION, wxDefaultPosition); + if (updateNotification->ShowModal() == wxID_YES) + ProcessPackageUpdates("../updates", "./packages"); + break; case UPDATE_GLOB_AVAIL: // there's an update with globalization strings attached updateMsg = updateMsg + "**Note that the update requires you to reglobalize, which will take 5-20 minutes.**\n" + "Before clicking Yes, MAKE SURE you have backed up any mods not installed through\n " + @@ -152,7 +161,6 @@ bool AEInstallerApp::OnInit() "If you click Yes, the Installer will quit and re-launch itself, then\n" + "you will be prompted to begin the installation."; updateNotification = new wxMessageDialog(TheWindow, updateMsg.c_str(), "AE Installer Alert", wxYES_NO | wxICON_EXCLAMATION, wxDefaultPosition); - updateNotification->ShowModal(); if (updateNotification->ShowModal() == wxID_YES) { if (ProcessInstallerUpdate(¤tAE, &updateAE)) // there's an intentional logic gap here: if the user clicks "Yes"... @@ -165,11 +173,12 @@ bool AEInstallerApp::OnInit() break; case UPDATE_INST_REPL_ERR: // the Installer replacement failed, user has to do it :-( updateMsg = "The Installer replacement process failed for some reason.\n"; - updateMsg = updateMsg + "Please quit, go into the folder Edition/Updates/" + strEUFN + "/install/ and drag the Installer to Edition/install/, " + - "replacing the current Installer application, then launch the new version."; - updateNotification = new wxMessageDialog(TheWindow, updateMsg.c_str(), "AE Installer Alert", wxOK | wxICON_EXCLAMATION, wxDefaultPosition); - updateNotification->ShowModal(); - TheWindow->Close(); + updateMsg = updateMsg + "In order for the update to continue, go into the folder Edition/updates/" + strEUFN + "/install/ and " + + "drag the Installer to Edition/install/, replacing the current Installer application, then launch the " + + "new version. Click Yes to quit."; + updateNotification = new wxMessageDialog(TheWindow, updateMsg.c_str(), "AE Installer Alert", wxYES_NO | wxICON_EXCLAMATION, wxDefaultPosition); + if (updateNotification->ShowModal() == wxID_YES) + TheWindow->Close(); return true; } }