@@ -577,9 +577,10 @@ SString CInstallManager::_ProcessGtaVersionCheck()
577577 }
578578
579579 // Check required GTA file is correct
580- if (GenerateHashHexStringFromFile (EHashFunctionType::MD5, strPatchBase) != strPatchBaseMd5)
580+ SString strPatchBaseCurrentMd5 = GenerateHashHexStringFromFile (EHashFunctionType::MD5, strPatchBase);
581+ if (strPatchBaseCurrentMd5 != strPatchBaseMd5)
581582 {
582- AddReportLog (5053 , SString (" _ProcessGtaVersionCheck: Incorrect file '%s'" , *strPatchBase));
583+ AddReportLog (5053 , SString (" _ProcessGtaVersionCheck: Incorrect file '%s' %d %s " , *strPatchBase, ( int ) FileSize (strPatchBase), *strPatchBaseCurrentMd5 ));
583584 SString strMessage (_ (" MTA:SA cannot continue because the following files are incorrect:" ));
584585 strMessage += " \n\n " + strPatchBase;
585586#ifdef TO_DO
@@ -590,6 +591,9 @@ SString CInstallManager::_ProcessGtaVersionCheck()
590591#endif
591592 }
592593
594+ // Ensure GTA exe is not running
595+ TerminateGTAIfRunning ();
596+
593597 // Backup current gta_sa.exe
594598 SString strGTAExeBak = strGtaExe + " .bak" ;
595599 if (!FileExists (strGTAExeBak))
@@ -605,7 +609,7 @@ SString CInstallManager::_ProcessGtaVersionCheck()
605609 {
606610 if (!IsUserAdmin ())
607611 {
608- AddReportLog (3052 , SString (" _ProcessGtaVersionCheck: GenerateFile failed (%d) - trying as admin" , result));
612+ AddReportLog (3052 , SString (" _ProcessGtaVersionCheck: GenerateFile failed (%d) - trying as admin %s " , result, *fileGenerator. GetErrorRecords () ));
609613 m_strAdminReason = _ (" Patch GTA" );
610614 return " fail" ;
611615 }
0 commit comments