You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MTADiag/Diag.cpp
+39-13Lines changed: 39 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -72,23 +72,43 @@ void Diag::Begin ( void )
72
72
exit ( EXIT_FAILURE ); // exit
73
73
};
74
74
75
-
// update MTA to latest nightly/unstable build, depending on the major version
76
-
UpdateMTA();
75
+
// check if MTA version matches the latest auto-update nightly
76
+
if ( Curl::DownloadFile ( MTAVerURL, files[5].c_str() ) ) // download the version appropriation HTML
77
+
{
78
+
std::string MTAVersionTrim = MTAVersion; // copy the MTAVersion string
79
+
MTAVersionTrim.resize ( 15 ); // trim the MTAVersion string stored in registry to 15 characters; the version appropriation HTML has a 15 char string lacking two trailing zeros
80
+
if ( FindInFile ( files[5].c_str(), ( MTAVersionTrim ) ) ) // look for the current MTA version string in it
81
+
std::cout << "MTA is up-to-date." << std::endl << std::endl; // we've found it, hooray, we don't need to update MTA
82
+
else
83
+
UpdateMTA(); // update MTA to latest nightly / unstable build, depending on MTA's major version
84
+
}
77
85
78
-
// write a bunch of information to the log file since we just collected it
86
+
// write some information to the log file
79
87
Log::WriteStringToLog ( "MTA path: ", MTAPath );
88
+
89
+
if ( MTAUpdated ) // was MTA updated? if so, list the old and new versions
90
+
{
80
91
Log::WriteStringToLog ( "Old MTA version: ", OriginalMTAVersion );
81
92
Log::WriteStringToLog ( "New MTA version: ", MTAVersion );
files.push_back ( tempDir + "\\MTANightly.exe" ); // filepath for nightly
202
224
files.push_back ( tempDir + "\\WMICUni.txt" ); // WMIC command outputs as Unicode; we convert this file to ASCII for proper insertion & formatting in the log
203
225
files.push_back ( systemRoot + "\\system32\\D3DX9_43.dll" ); // we check for the presence of this file to determine if DirectX is up to date
0 commit comments