@@ -48,8 +48,12 @@ void Diag::Begin ( void )
48
48
else { UpdateDirectX (); DXUpdated = 1 ; }
49
49
50
50
// remove any compatibility mode settings on gta_sa.exe and/or Multi Theft Auto.exe
51
+
52
+ // check HKCU first
51
53
CompatRemoved1 = DeleteCompatibilityEntries ( CompatModeRegKey, HKEY_CURRENT_USER );
52
- CompatRemoved2 = DeleteCompatibilityEntries ( CompatModeRegKey, HKEY_LOCAL_MACHINE );
54
+ // check HKLM for compat. mode settings set for all users
55
+ // only check 32-bit OSes due to compat. mode settings *NOT* being written to Wow6432Node on 64-bit OSes, and I can't seem to query non-Wow6432Node keys
56
+ if ( !bIsWOW64 ) { CompatRemoved2 = DeleteCompatibilityEntries ( CompatModeRegKey, HKEY_LOCAL_MACHINE ); }
53
57
54
58
// update MTA to latest nightly/unstable build, depending on the version
55
59
UpdateMTA ();
@@ -86,7 +90,7 @@ void Diag::Begin ( void )
86
90
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ logfile.txt" , " logfile.txt" );
87
91
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ CEGUI.log" , " CEGUI.log" );
88
92
Log::WriteFileToLog ( MTAPath + " \\ MTA\\ timings.log" , " timings.log" );
89
- if ( IsVistaOrNewer () ) { Log::WriteFileToLog ( programData + " \\ MTA San Andreas All\\ " + MTAShortVersion + " \\ report.log" , " report.log" ); }
93
+ if ( bIsVistaOrNewer ) { Log::WriteFileToLog ( programData + " \\ MTA San Andreas All\\ " + MTAShortVersion + " \\ report.log" , " report.log" ); }
90
94
91
95
DoSystemCommandWithOutput ( " ipconfig /all >" ); // get network configuration
92
96
DoSystemCommandWithOutput ( " wevtutil qe Application /q:\" Event [System [(Level=2)] ] [EventData [(Data='Multi Theft Auto.exe')] ]\" /c:1 /f:text /rd:true >" ); // might help resolve Visual C++ runtime issues
@@ -97,6 +101,11 @@ void Diag::Begin ( void )
97
101
GetDir ( GTAPath );
98
102
GetDir ( ( GTAPath + " \\ models" ) );
99
103
104
+ // font diagnostics
105
+ Log::WriteStringToLog ( " Verdana (TrueType) registry value:" , ReadRegKey ( " Verdana (TrueType)" , " SOFTWARE\\ Microsoft\\ Windows NT\\ CurrentVersion\\ Fonts\\ " ) );
106
+ Log::WriteStringToLog ( " " );
107
+ GetDir ( systemRoot + " \\ fonts\\ verd*" );
108
+
100
109
// close the log file for writing
101
110
Log::Close ();
102
111
@@ -105,20 +114,27 @@ void Diag::Begin ( void )
105
114
106
115
PasteBinResult = Curl::CreatePasteBin ( files[0 ], logFileName ); // store the HTTP POST result into PasteBinResult
107
116
108
- // deal with a couple of errors in case there are any
109
- if ( strstr ( PasteBinResult.c_str (), " Bad API request" ) || strstr ( PasteBinResult.c_str (), " Post limit" ) )
117
+ // upload successful; copy URL to clipboard
118
+ if ( strstr ( PasteBinResult.c_str (), " http://pastebin.com/" ) )
119
+ {
120
+ if ( CopyToClipboard ( PasteBinResult ) ) // was copying to clipboard successful?
121
+ {
122
+ std::cout << " Pastebin link copied to your clipboard." << std::endl << " Please include the Pastebin link in your forum post." << std::endl;
123
+ }
124
+ else // just in case that didn't work
125
+ {
126
+ std::cout << " Log file uploaded to Pastebin. Please include the Pastebin link in your forum post:" << std::endl;
127
+ std::cout << PasteBinResult << std::endl;
128
+ }
129
+ }
130
+ else // upload failure
110
131
{
111
132
std::cout << std::endl << std::endl << " Failed to upload log file to Pastebin." << std::endl;
112
133
std::cout << " Error code: \" " << PasteBinResult << " \" " << std::endl;
113
134
std::cout << " Please paste the contents of the opened Wordpad window at www.pastebin.com." << std::endl;
114
- std::cout << " Include the Pastebin link in your forum post." << std::endl << std::endl;
135
+ std::cout << " Include the Pastebin link in your forum post." << std::endl << std::endl;
115
136
ShellExecute ( NULL , " open" , " wordpad.exe" , files[0 ].c_str (), NULL , SW_SHOW );
116
137
}
117
- else // upload successful; open the pasted log file in a browser window
118
- {
119
- std::cout << " Log file uploaded to Pastebin. Please include the Pastebin link in your forum post." << std::endl;
120
- ShellExecute ( NULL , " open" , " rundll32.exe" , ( " url.dll,FileProtocolHandler " + PasteBinResult ).c_str (), NULL , SW_SHOW );
121
- }
122
138
}
123
139
124
140
void Diag::Cleanup ( void )
@@ -132,9 +148,11 @@ void Diag::Cleanup ( void )
132
148
void Diag::GeneratePaths ( void )
133
149
{
134
150
// obtain Temp and WINDOWS environment variables, and store system time
151
+ bIsVistaOrNewer = IsVistaOrNewer (); // is the user running Vista or newer?
135
152
tempDir = getenv ( " Temp" ); // get the Temp directory
136
153
systemRoot = getenv ( " SystemRoot" ); // get the WINDOWS directory
137
- if ( IsVistaOrNewer () ) { programData = getenv ( " ProgramData" ); } // get the ProgramData directory
154
+ if ( bIsVistaOrNewer ) { programData = getenv ( " ProgramData" ); } // get the ProgramData directory
155
+ IsWow64Process ( GetCurrentProcess (), &bIsWOW64 ); // is MTADiag running under WOW64?
138
156
GetLocalTime ( &sysTime ); // get the current system time
139
157
140
158
// generate necessary file paths
0 commit comments