@@ -78,6 +78,7 @@ void Diag::Begin ( void )
78
78
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ logfile.txt" , " logfile.txt" );
79
79
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ CEGUI.log" , " CEGUI.log" );
80
80
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ timings.log" , " timings.log" );
81
+ if ( IsVistaOrNewer () ) { Log::WriteFileToLog ( programData + " \\ MTA San Andreas All\\ " + MTAShortVersion + " \\ report.log" , " report.log" ); }
81
82
82
83
QueryWMIC ( " Path" , " Win32_VideoController" , " Get" );
83
84
@@ -125,6 +126,7 @@ void Diag::GeneratePaths ( void )
125
126
// obtain Temp and WINDOWS environment variables, and store system time
126
127
tempDir = getenv ( " Temp" ); // get the Temp directory
127
128
systemRoot = getenv ( " SystemRoot" ); // get the WINDOWS directory
129
+ if ( IsVistaOrNewer () ) { programData = getenv ( " ProgramData" ); } // get the ProgramData directory
128
130
GetLocalTime ( &sysTime ); // get the current system time
129
131
130
132
// generate necessary file paths
@@ -137,11 +139,11 @@ void Diag::GeneratePaths ( void )
137
139
ss.str (" " );
138
140
ss.clear ();
139
141
140
- files.push_back ( tempDir + " \\ " + logFileName + " .txt" ); // files [0] ...
141
- files.push_back ( tempDir + " \\ tempoutput.txt" );
142
- files.push_back ( tempDir + " \\ MTANightly.exe" );
143
- files.push_back ( tempDir + " \\ WMICUni.txt" );
144
- files.push_back ( systemRoot + " \\ system32\\ D3DX9_43.dll" );
142
+ files.push_back ( tempDir + " \\ " + logFileName + " .txt" ); // files [0] ... / log file path
143
+ files.push_back ( tempDir + " \\ tempoutput.txt" ); // general temporary output file for almost everything
144
+ files.push_back ( tempDir + " \\ MTANightly.exe" ); // filepath for nightly
145
+ files.push_back ( tempDir + " \\ WMICUni.txt" ); // WMIC command outputs as ASCII; convert to unicode for proper insertion & formatting in the log
146
+ files.push_back ( systemRoot + " \\ system32\\ D3DX9_43.dll" ); // we check for this file to see if DirectX is up to date
145
147
146
148
#ifdef DEBUGOUTPUT
147
149
for ( int i = 0 ; i < ( signed ) files.size (); i++ )
@@ -158,7 +160,7 @@ bool Diag::PollMTAVersions ( void )
158
160
MTAVersionsInstalled[5 ] = ReadRegKey ( MTAPathValue, MTA15PathSubKey ); // store MTA 1.5 path, if present
159
161
160
162
// if a version isn't installed, "Failed to get key." is returned by readRegKey; clear that array element
161
- for ( int i = 1 ; i < CUR_MTA_VERSIONS; i++ )
163
+ for ( int i = 1 ; i <= CUR_MTA_VERSIONS; i++ )
162
164
{
163
165
if ( !strcmp ( MTAVersionsInstalled[i].c_str (), " Failed to read key." ) )
164
166
MTAVersionsInstalled[i].assign ( " " );
@@ -167,7 +169,7 @@ bool Diag::PollMTAVersions ( void )
167
169
// check how many versions of MTA:SA are installed; if there's only one, we'll narrow it down and set MTAVerChoice to that version
168
170
int versionCounter = 0 ;
169
171
170
- for (int i = 1 ; i < CUR_MTA_VERSIONS; i++)
172
+ for (int i = 1 ; i <= CUR_MTA_VERSIONS; i++)
171
173
{
172
174
if ( !MTAVersionsInstalled[i].empty () )
173
175
{
@@ -183,14 +185,14 @@ bool Diag::PollMTAVersions ( void )
183
185
// or is not running this program as Administrator when they should be
184
186
else if ( versionCounter == 0 )
185
187
{
186
- std::cout << " Can't read MTA path." << std::endl << " You are either not running this program as an Administrator, " << std::endl ;
187
- std::cout << " or you may be running a version of MTA older than 1.1." << std::endl;
188
+ std::cout << " Can't read MTA path." << std::endl;
189
+ std::cout << " You may be running a version of MTA older than 1.1." << std::endl;
188
190
std::cout << " Update at www.mtasa.com, then run MTADiag again if necessary." << std::endl;
189
191
system ( " pause" );
190
192
exit ( EXIT_FAILURE );
191
193
}
192
194
else
193
- return false ; // return false signifying that there are multiple versions of MTA:SA installed
195
+ return false ; // return false, signifying that there are multiple versions of MTA:SA installed
194
196
}
195
197
196
198
void Diag::UserPickVersion ( void )
@@ -249,22 +251,27 @@ std::string Diag::GetMTAVersion ( void )
249
251
{
250
252
case 1 :
251
253
MTAVersion = ReadRegKey ( MTAVerValue, MTA11VerSubKey );
254
+ MTAShortVersion = " 1.1" ;
252
255
return MTAVersion;
253
256
break ;
254
257
case 2 :
255
258
MTAVersion = ReadRegKey ( MTAVerValue, MTA12VerSubKey );
259
+ MTAShortVersion = " 1.2" ;
256
260
return MTAVersion;
257
261
break ;
258
262
case 3 :
259
263
MTAVersion = ReadRegKey ( MTAVerValue, MTA13VerSubKey );
264
+ MTAShortVersion = " 1.3" ;
260
265
return MTAVersion;
261
266
break ;
262
267
case 4 :
263
268
MTAVersion = ReadRegKey ( MTAVerValue, MTA14VerSubKey );
269
+ MTAShortVersion = " 1.4" ;
264
270
return MTAVersion;
265
271
break ;
266
272
case 5 :
267
273
MTAVersion = ReadRegKey ( MTAVerValue, MTA15VerSubKey );
274
+ MTAShortVersion = " 1.5" ;
268
275
return MTAVersion;
269
276
break ;
270
277
}
0 commit comments