@@ -72,6 +72,7 @@ void Diag::Begin ( void )
72
72
#endif
73
73
DoSystemCommandWithOutput ( " tasklist >" );
74
74
DoSystemCommandWithOutput ( " ipconfig /all >" );
75
+ DoSystemCommandWithOutput ( " wevtutil qe Application /q:\" Event [System [(Level=2)] ] [EventData [(Data='Multi Theft Auto.exe')] ]\" /c:1 /f:text /rd:true >" );
75
76
76
77
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ core.log" , " core.log" );
77
78
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ logfile.txt" , " logfile.txt" );
@@ -81,9 +82,9 @@ void Diag::Begin ( void )
81
82
QueryWMIC ( " Path" , " Win32_VideoController" , " Get" );
82
83
83
84
ExportRegKeyToFile ( CompatModeRegKey1 );
84
- TrimCompatabilityExport ( files[ 1 ] );
85
+ TrimCompatabilityExport ( );
85
86
ExportRegKeyToFile ( CompatModeRegKey2 );
86
- TrimCompatabilityExport ( files[ 1 ] );
87
+ TrimCompatabilityExport ( );
87
88
88
89
GetDir ( ( MTAPath + " \\ MTA" ) );
89
90
GetDir ( GTAPath );
@@ -115,7 +116,7 @@ void Diag::Cleanup ( void )
115
116
{
116
117
// clean up after ourselves
117
118
// start at 1 since 0 is the generated log's path; we still need that
118
- for (int i = 1 ; i < ( signed ) files.size () - 1 ; i++)
119
+ for (int i = 1 ; i < ( signed ) files.size () - 1 ; i++) // don't delete D3DX9_43.dll
119
120
remove ( files[i].c_str () );
120
121
}
121
122
@@ -329,6 +330,7 @@ void Diag::UpdateMTA ( void )
329
330
{
330
331
std::cout << " Enjoy playing MTA!" << std::endl;
331
332
Cleanup ();
333
+ remove ( Diag::files[0 ].c_str () ); // remove the generated MTADiag log
332
334
system ( " pause" );
333
335
exit ( EXIT_SUCCESS );
334
336
}
@@ -346,10 +348,10 @@ void Diag::UpdateDirectX ( void )
346
348
std::cout << " DirectX is not up-to-date." << std::endl;
347
349
std::cout << " Downloading web updater..." << std::endl;
348
350
349
- if ( Curl::DownloadFile ( DXWebSetupURL.c_str (), DXWebSetupPath.c_str () ) )
351
+ if ( Curl::DownloadFile ( DXWebSetupURL.c_str (), DXWebSetupPath.c_str () ) )
350
352
{
351
353
std::cout << std::endl << " Follow the instructions to update DirectX." << std::endl << std::endl;
352
- system ( DXWebSetupPath.c_str () );
354
+ system ( DXWebSetupPath.c_str () );
353
355
}
354
356
else
355
357
{
@@ -422,12 +424,12 @@ void Diag::ExportRegKeyToFile ( std::string subkey )
422
424
system ( ExportReg.c_str () );
423
425
}
424
426
425
- void Diag::TrimCompatabilityExport ( std::string filePath )
427
+ void Diag::TrimCompatabilityExport ( void )
426
428
{
427
429
std::ifstream file;
428
430
std::string line;
429
431
430
- file.open ( filePath .c_str (), std::ios::in );
432
+ file.open ( files[ 1 ] .c_str (), std::ios::in );
431
433
432
434
if ( file )
433
435
{
0 commit comments