Skip to content

Commit 3cb2494

Browse files
committed
Minor tweaks
1 parent 82b754f commit 3cb2494

File tree

5 files changed

+17
-36
lines changed

5 files changed

+17
-36
lines changed

MTADiag/Common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
#include <vector>
2323
#include "Log.h"
2424

25-
#define VERSION "2.6"
25+
#define VERSION "2.6.4"

MTADiag/Diag.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ void Diag::Begin ( void )
6767
if ( bQuit )
6868
{
6969
std::cout << "Your Grand Theft Auto installation is missing one or more files." << std::endl << "Please reinstall GTA and see if MTA works then." << std::endl;
70-
Cleanup(); // clean up any temporary files that might have been created
71-
Log::Close(); // close the log file for writing
72-
remove ( files[0].c_str() ); // remove the MTADiag log
70+
Cleanup ( true ); // clean up any temporary files that might have been created
71+
system ( "pause" );
7372
exit ( EXIT_FAILURE ); // exit
7473
};
7574

@@ -107,7 +106,7 @@ void Diag::Begin ( void )
107106
Log::WriteFileToLog ( MTAPath + "\\MTA\\core.log", "core.log" );
108107
Log::WriteFileToLog ( MTAPath + "\\MTA\\logfile.txt", "logfile.txt" );
109108
Log::WriteFileToLog ( MTAPath + "\\MTA\\CEGUI.log", "CEGUI.log" );
110-
Log::WriteFileToLog ( MTAPath + "\\MTA\\timings.log", "timings.log" );
109+
Log::WriteFileToLog ( MTAPath + "\\timings.log", "timings.log" );
111110
if ( IsVistaOrNewer() ) { Log::WriteFileToLog ( programData + "\\MTA San Andreas All\\" + MTAShortVersion + "\\report.log", "report.log" ); }
112111

113112
DoSystemCommandWithOutput ( "ipconfig /all >" ); // get network configuration
@@ -163,12 +162,18 @@ void Diag::Begin ( void )
163162
}
164163
}
165164

166-
void Diag::Cleanup ( void )
165+
void Diag::Cleanup ( bool deleteLog )
167166
{
168167
// clean up after ourselves
169168
// start at 1 since 0 is the generated log's path; we still need that
170169
for ( unsigned int i = 1; i < files.size() - 1; i++) // don't delete D3DX9_43.dll
171170
remove ( files[i].c_str() );
171+
172+
if ( deleteLog )
173+
{
174+
Log::Close(); // close the log file for writing
175+
remove ( files[0].c_str() ); // remove the MTADiag log
176+
}
172177
}
173178

174179
void Diag::GeneratePaths ( void )
@@ -338,11 +343,13 @@ void Diag::GeneratePaths ( void )
338343
GTAFiles.push_back ( "\\data\\Decision\\Imran\\std1_is.ped" );
339344
GTAFiles.push_back ( "\\data\\Decision\\Imran\\std2_is.ped" );
340345

346+
/*
341347
GTAFiles.push_back ( "\\data\\Icons\\app.ico" );
342348
GTAFiles.push_back ( "\\data\\Icons\\bin.ico" );
343349
GTAFiles.push_back ( "\\data\\Icons\\saicon.ICN" );
344350
GTAFiles.push_back ( "\\data\\Icons\\saicon2.ICN" );
345351
GTAFiles.push_back ( "\\data\\Icons\\saicon3.ICN" );
352+
*/
346353

347354
GTAFiles.push_back ( "\\data\\maps\\Audiozon.ipl" );
348355
GTAFiles.push_back ( "\\data\\maps\\cull.ipl" );
@@ -636,16 +643,7 @@ void Diag::GeneratePaths ( void )
636643
GTAFiles.push_back ( "\\models\\txd\\splash2.txd" );
637644
GTAFiles.push_back ( "\\models\\txd\\splash3.txd" );
638645

639-
GTAFiles.push_back ( "\\movies\\GTAtitles.mpg" );
640-
GTAFiles.push_back ( "\\movies\\Logo.mpg" );
641-
642-
GTAFiles.push_back ( "\\ReadMe\\Readme.txt" );
643-
644646
GTAFiles.push_back ( "\\text\\american.gxt" );
645-
GTAFiles.push_back ( "\\text\\french.gxt" );
646-
GTAFiles.push_back ( "\\text\\german.gxt" );
647-
GTAFiles.push_back ( "\\text\\italian.gxt" );
648-
GTAFiles.push_back ( "\\text\\spanish.gxt" );
649647

650648
// output contents of files vector
651649
#ifdef DEBUGOUTPUT

MTADiag/Diag.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
namespace Diag {
4949

5050
void Begin ( void );
51-
void Cleanup ( void );
51+
void Cleanup ( bool deleteLog = false );
5252

5353
// gather all currently installed MTA:SA versions and ask the user to pick between them if necessary
5454
void GeneratePaths ( void );

MTADiag/util.cpp

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ bool DeleteCompatibilityEntries ( std::string subkey, HKEY hKeyType )
7878
{
7979
if ( IsWin8OrNewer() ) // is the user running Windows 8 or newer?
8080
{
81-
char Win8Data[13] = "~ RUNASADMIN"; // set the data buffer to the proper string
81+
const char Win8Data[13] = "~ RUNASADMIN"; // set the data buffer to the proper string
8282
RegSetValueEx ( hKey, buf, 0, dwType, ( BYTE* ) Win8Data, sizeof (Win8Data) ); // set the value data to RUNASADMIN only
8383
changed = true;
8484
index--;
8585
continue;
8686
}
8787
else // 7 or older
8888
{
89-
char XPData[11] = "RUNASADMIN"; // set the data buffer to the proper string
89+
const char XPData[11] = "RUNASADMIN"; // set the data buffer to the proper string
9090
RegSetValueEx ( hKey, buf, 0, dwType, ( BYTE* ) XPData, sizeof (XPData) ); // set the value data to RUNASADMIN only
9191
changed = true;
9292
index--;
@@ -181,23 +181,6 @@ bool IsVistaOrNewer ( void )
181181
return false;
182182
}
183183

184-
// slightly modified version of http://msdn.microsoft.com/en-us/library/ms724451%28VS.85%29.aspx
185-
bool IsWin7 ( void )
186-
{
187-
OSVERSIONINFO osvi;
188-
bool bIsWin7OrNewer;
189-
190-
ZeroMemory ( &osvi, sizeof ( OSVERSIONINFO ) );
191-
osvi.dwOSVersionInfoSize = sizeof ( OSVERSIONINFO );
192-
193-
GetVersionEx ( &osvi );
194-
195-
if ( ( bIsWin7OrNewer = ( osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1 ) ) != 0 )
196-
return true;
197-
else
198-
return false;
199-
}
200-
201184
// slightly modified version of http://msdn.microsoft.com/en-us/library/ms724451%28VS.85%29.aspx
202185
bool IsWin8OrNewer ( void )
203186
{

MTADiag/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "Common.h"
1818
#include "md5.h"
19+
1920
// Compatability mode registry key
2021
#define CompatModeRegKey "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers"
2122

@@ -25,6 +26,5 @@ bool CheckForFile ( std::string FilePath );
2526
void ConvertUnicodeToASCII ( std::string file1, std::string file2 );
2627
bool CopyToClipboard ( std::string contents );
2728
bool IsVistaOrNewer ( void );
28-
bool IsWin7 ( void );
2929
bool IsWin8OrNewer ( void );
3030
std::string GetFileMD5 ( std::string filename );

0 commit comments

Comments
 (0)