| 18 |
|
////@begin includes |
| 19 |
|
////@end includes |
| 20 |
|
|
| 21 |
+ |
extern int updateStatus; |
| 22 |
+ |
extern bool installerJustUpdated; |
| 23 |
|
Install_info_cfg currentAE, updateAE; |
| 24 |
|
MainWindow* TheWindow; |
| 25 |
|
|
| 112 |
|
return true; |
| 113 |
|
} |
| 114 |
|
|
| 115 |
< |
bool installerJustUpdated = false; |
| 114 |
< |
int updateStatus = GetUpdateStatus(¤tAE, &updateAE, &installerJustUpdated); |
| 115 |
< |
if (updateStatus) // otherwise there's no update |
| 115 |
> |
if (updateStatus) // updateStatus was set when MainWindow::CreateControls() was called during initialization of the window |
| 116 |
|
{ |
| 117 |
< |
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... |
| 118 |
< |
updateMsg = updateMsg + "Do you wish to update to Edition version " + updateAE.AEVersion + "?\n" + |
| 119 |
< |
"(Current version is " + currentAE.AEVersion + ")\n"; // ...so tack the rest on in a second command |
| 117 |
> |
string updateMsg = "An update for the Anniversary Edition is available.\n" |
| 118 |
> |
"Do you wish to update to Edition version " + updateAE.AEVersion + "?\n" |
| 119 |
> |
"(Current version is " + currentAE.AEVersion + ")\n"; // ...so we tack the rest on in a second command |
| 120 |
|
wxMessageDialog* updateNotification; |
| 121 |
|
|
| 122 |
|
switch (updateStatus) // for the meanings of these return values, see the comments preceding installer.cpp's GetUpdateStatus() |
| 130 |
|
break; |
| 131 |
|
case UPDATE_MNTH_REQD_ERR: |
| 132 |
|
updateMsg = "There is a patch in the updates/ folder, but it patches the\n"; |
| 133 |
< |
updateMsg = updateMsg + updateAE.AEVersion.substr(0, updateAE.AEVersion.length() - 1) + " release; it cannot update this version of the Edition."; |
| 133 |
> |
updateMsg = updateMsg + updateAE.AEVersion + " release; it cannot update this version of the Edition."; |
| 134 |
|
updateNotification = new wxMessageDialog(TheWindow, updateMsg.c_str(), "AE Installer Alert", wxOK | wxICON_EXCLAMATION, wxDefaultPosition); |
| 135 |
|
updateNotification->ShowModal(); |
| 136 |
|
break; |
| 139 |
|
if (updateNotification->ShowModal() == wxID_YES) |
| 140 |
|
ProcessAEUpdate(¤tAE, &updateAE, &installerJustUpdated); |
| 141 |
|
break; |
| 142 |
+ |
case UPDATE_PKG_AVAIL: // there's an update with no globalization or Installer strings attached |
| 143 |
+ |
updateMsg = (string)"One or individual package updates for the Anniversary Edition is available.\n\n" + |
| 144 |
+ |
(string)"Please note that the AE team assumes no responsibility for the content of third party mods " + |
| 145 |
+ |
(string)"nor effects that a third party mod may have on your install.\n\n" + |
| 146 |
+ |
(string)"Do you wish to install these update(s)?"; |
| 147 |
+ |
updateNotification = new wxMessageDialog(TheWindow, updateMsg.c_str(), "AE Installer Alert", wxYES_NO | wxICON_EXCLAMATION, wxDefaultPosition); |
| 148 |
+ |
if (updateNotification->ShowModal() == wxID_YES) |
| 149 |
+ |
ProcessPackageUpdates("../updates", "./packages"); |
| 150 |
+ |
break; |
| 151 |
|
case UPDATE_GLOB_AVAIL: // there's an update with globalization strings attached |
| 152 |
|
updateMsg = updateMsg + "**Note that the update requires you to reglobalize, which will take 5-20 minutes.**\n" + |
| 153 |
|
"Before clicking Yes, MAKE SURE you have backed up any mods not installed through\n " + |
| 161 |
|
"If you click Yes, the Installer will quit and re-launch itself, then\n" + |
| 162 |
|
"you will be prompted to begin the installation."; |
| 163 |
|
updateNotification = new wxMessageDialog(TheWindow, updateMsg.c_str(), "AE Installer Alert", wxYES_NO | wxICON_EXCLAMATION, wxDefaultPosition); |
| 155 |
– |
updateNotification->ShowModal(); |
| 164 |
|
if (updateNotification->ShowModal() == wxID_YES) |
| 165 |
|
{ |
| 166 |
|
if (ProcessInstallerUpdate(¤tAE, &updateAE)) // there's an intentional logic gap here: if the user clicks "Yes"... |
| 173 |
|
break; |
| 174 |
|
case UPDATE_INST_REPL_ERR: // the Installer replacement failed, user has to do it :-( |
| 175 |
|
updateMsg = "The Installer replacement process failed for some reason.\n"; |
| 176 |
< |
updateMsg = updateMsg + "Please quit, go into the folder Edition/Updates/" + strEUFN + "/install/ and drag the Installer to Edition/install/, " + |
| 177 |
< |
"replacing the current Installer application, then launch the new version."; |
| 178 |
< |
updateNotification = new wxMessageDialog(TheWindow, updateMsg.c_str(), "AE Installer Alert", wxOK | wxICON_EXCLAMATION, wxDefaultPosition); |
| 179 |
< |
updateNotification->ShowModal(); |
| 180 |
< |
TheWindow->Close(); |
| 176 |
> |
updateMsg = updateMsg + "In order for the update to continue, go into the folder Edition/updates/" + strEUFN + "/install/ and " + |
| 177 |
> |
"drag the Installer to Edition/install/, replacing the current Installer application, then launch the " + |
| 178 |
> |
"new version. Click Yes to quit."; |
| 179 |
> |
updateNotification = new wxMessageDialog(TheWindow, updateMsg.c_str(), "AE Installer Alert", wxYES_NO | wxICON_EXCLAMATION, wxDefaultPosition); |
| 180 |
> |
if (updateNotification->ShowModal() == wxID_YES) |
| 181 |
> |
TheWindow->Close(); |
| 182 |
|
return true; |
| 183 |
|
} |
| 184 |
|
} |