@@ -576,79 +576,16 @@ SectionGroup /e "$(INST_SEC_CLIENT)" SECGCLIENT
576
576
Call RemoveVirtualStore
577
577
${EndIf}
578
578
${EndIf}
579
- # ############################################################
580
-
581
- # Handle "Grand Theft Auto San Andreas.exe" being present instead of gta_sa.exe
582
- IfFileExists " $GTA_DIR\gta_sa.exe" noCopyReq
583
- IfFileExists " $GTA_DIR\Grand Theft Auto San Andreas.exe" 0 noCopyReq
584
- CopyFiles " $GTA_DIR\Grand Theft Auto San Andreas.exe" " $GTA_DIR\gta_sa.exe"
585
- noCopyReq:
586
579
587
580
# ############################################################
588
- # Patch our San Andreas .exe if it is required
589
- nsArray::SetList array " gta_sa.exe" " gta-sa.exe" " testapp.exe" /end
590
- ${ForEachIn} array $0 $1
591
- IfFileExists $GTA_DIR \$1 0 TryNextExe
592
- ${GetSize} " $GTA_DIR" " /M=$1 /S=0M /G=0" $0 $3 $4
593
- StrCmp " $0" " 0" TryNextExe
594
- !insertmacro GetMD5 $GTA_DIR \$1 $ExeMD5
595
- DetailPrint " $1 successfully detected ($ExeMD5)"
596
- ${LogText} " GetMD5 $GTA_DIR\$1 $ExeMD5"
597
- ${Switch} $ExeMD5
598
- ${Case} " bf25c28e9f6c13bd2d9e28f151899373" # US 2.00
599
- ${Case} " 7fd5f9436bd66af716ac584ff32eb483" # US 1.01
600
- ${Case} " d84326ba0e0ace89f87288ffe7504da4" # EU 3.00 Steam Mac
601
- ${Case} " 4e99d762f44b1d5e7652dfa7e73d6b6f" # EU 2.00
602
- ${Case} " 2ac4b81b3e85c8d0f9846591df9597d3" # EU 1.01
603
- ${Case} " d0ad36071f0e9bead7bddea4fbda583f" # EU 1.01 GamersGate
604
- ${Case} " 25405921d1c47747fd01fd0bfe0a05ae" # EU 1.01 DEViANCE
605
- ${Case} " a2929a61e4d63dd3c15749b2b7ed74ae" # ?? 1.01
606
- ${Case} " 9effcaf66b59b9f8fb8dff920b3f6e63" # DE 2.00
607
- ${Case} " fa490564cd9811978085a7a8f8ed7b2a" # DE 1.01
608
- ${Case} " 49dd417760484a18017805df46b308b8" # DE 1.00
609
- ${Case} " 185f0970f5913d0912a89789af175ffe" # ?? ?.?? 4,496,063 bytes
610
- ${Case} " 0fd315d1af41e26e536a78b4d4556488" # EU 3.00 Steam 2007-12-04 11:50:50 5697536
611
- ${Case} " 2ed36a3cee7b77da86a343838e3516b6" # EU 3.01 Steam (2014 Nov update) 2014-10-14 21:58:05 5971456
612
- ${Case} " 5bfd4dd83989a8264de4b8e771f237fd" # EU 3.02 Steam (2014 Dec update) 2014-12-01 20:43:21 5971456
613
- ${Case} " d9cb35c898d3298ca904a63e10ee18d7" # DE 3.02 Steam (2014 Dec update) 2016-08-11 20:57:22 5971456
614
- ${Case} " c29d96e0c063cd4568d977bcf273215f" # ?? ?.?? 5,719,552 bytes
615
- # Copy to gta_sa.exe.bak and patch to gta_sa.exe
616
- CopyFiles " $GTA_DIR\$1" " $GTA_DIR\gta_sa.exe.bak"
617
- StrCpy $PATCH_TARGET " $GTA_DIR\gta_sa.exe"
618
- Call InstallPatch
619
- ${If} $PatchInstalled == " 1"
620
- Goto CompletePatchProc
621
- ${EndIf}
622
- Goto TryNextExe
623
- ${Break}
624
-
625
- ${Case} " 6687a315558935b3fc80cdbff04437a4" # ?? ?.?? 5,685,688 bytes (RS Launcher 2019-08-29)
626
- # Don't patch if proxy_sa is already present (and is over 10MB)
627
- ${GetSize} " $GTA_DIR" " /M=proxy_sa.exe /S=0M /G=0" $0 $3 $4
628
- ${If} $0 > 10
629
- Goto CompletePatchProc
630
- ${EndIf}
631
- # Copy to gta_sa.exe.bak and patch to proxy_sa.exe
632
- CopyFiles " $GTA_DIR\$1" " $GTA_DIR\gta_sa.exe.bak"
633
- StrCpy $PATCH_TARGET " $GTA_DIR\proxy_sa.exe"
634
- Call InstallPatch
635
- ${If} $PatchInstalled == " 1"
636
- Goto CompletePatchProc
637
- ${EndIf}
638
- Goto TryNextExe
639
- ${Break}
640
- ${Default}
641
- ${If} $1 == " gta_sa.exe"
642
- Goto CompletePatchProc # This gta_sa.exe doesn't need patching, let's continue
643
- ${EndIf}
644
- ${Break}
645
- ${EndSwitch}
646
- TryNextExe:
647
- ${Next}
648
-
649
- NoExeFound:
581
+ # Issue warning if GTA path looks incorrect
582
+ Push $GTA_DIR
583
+ Call IsGtaDirectory
584
+ Pop $0
585
+ ${If} $0 != " gta"
650
586
MessageBox MB_ICONSTOP " $(MSGBOX_INVALID_GTASA)"
651
- CompletePatchProc:
587
+ ${EndIf}
588
+ # ############################################################
652
589
653
590
# ############################################################
654
591
# Fix missing or incorrect VS2013 redist files
@@ -1184,45 +1121,6 @@ Function SkipDirectoryPage
1184
1121
FunctionEnd
1185
1122
1186
1123
1187
- ; ====================================================================================
1188
- ; Patcher related functions
1189
- ; ====================================================================================
1190
- Var PATCHFILE
1191
-
1192
- LangString MSGBOX_PATCH_FAIL1 ${LANG_ENGLISH} " Unable to download the patch file for your version of Grand Theft Auto: San Andreas"
1193
- LangString MSGBOX_PATCH_FAIL2 ${LANG_ENGLISH} " Unable to install the patch file for your version of Grand Theft Auto: San Andreas"
1194
- Function InstallPatch
1195
- ${LogText} " +Function begin - InstallPatch"
1196
- DetailPrint " Incompatible version of San Andreas detected. Patching executable..."
1197
- StrCpy $PATCHFILE " $TEMP\$ExeMD5.GTASAPatch"
1198
- NSISdl::download " http://mirror.multitheftauto.com/gdata/$ExeMD5.GTASAPatch" $PATCHFILE
1199
- Pop $0
1200
- ${If} $0 != " success"
1201
- DetailPrint " * Download of patch file failed:"
1202
- DetailPrint " * $0"
1203
- DetailPrint " * Installation continuing anyway"
1204
- MessageBox MB_ICONSTOP " $(MSGBOX_PATCH_FAIL1)"
1205
- StrCpy $PatchInstalled " 0"
1206
- ${Else}
1207
- DetailPrint " Patch download successful. Installing patch..."
1208
- vpatch::vpatchfile " $PATCHFILE" " $GTA_DIR\gta_sa.exe.bak" $PATCH_TARGET
1209
- Pop $R0
1210
- ${If} $R0 == " OK"
1211
- StrCpy $PatchInstalled " 1"
1212
- ${ElseIf} $R0 == " OK, new version already installed"
1213
- StrCpy $PatchInstalled " 1"
1214
- ${Else}
1215
- StrCpy $PatchInstalled " 0"
1216
- DetailPrint " * Some error occured installing the patch for Grand Theft Auto: San Andreas:"
1217
- DetailPrint " * $R0"
1218
- DetailPrint " * It is required in order to run Multi Theft Auto : San Andreas"
1219
- DetailPrint " * Installation continuing anyway"
1220
- MessageBox MB_ICONSTOP MSGBOX_PATCH_FAIL2
1221
- ${EndIf}
1222
- ${EndIf}
1223
- ${LogText} " -Function end - InstallPatch"
1224
- FunctionEnd
1225
-
1226
1124
; ====================================================================================
1227
1125
; UAC related functions
1228
1126
; ====================================================================================
@@ -1891,8 +1789,8 @@ Function "GTADirectoryLeaveProc"
1891
1789
Abort
1892
1790
hasdir:
1893
1791
1894
- ; data subdirectory should exist
1895
- IfFileExists " $GTA_DIR\data\*.* " cont
1792
+ ; models\gta3.img should exist
1793
+ IfFileExists " $GTA_DIR\models\gta3.img " cont
1896
1794
MessageBox MB_OKCANCEL |MB_ICONQUESTION |MB_TOPMOST |MB_SETFOREGROUND \
1897
1795
" $(INST_GTA_ERROR2)" \
1898
1796
IDOK cont1
@@ -1916,17 +1814,10 @@ Function IsGtaDirectory
1916
1814
Pop $0
1917
1815
StrCpy $1 " gta"
1918
1816
1919
- ; gta_sa.exe or gta-sa.exe should exist
1920
- IfFileExists " $0\gta_sa.exe" cont1
1921
- IfFileExists " $0\gta-sa.exe" cont1
1922
- IfFileExists " $0\Grand Theft Auto San Andreas.exe" cont1
1923
- StrCpy $1 " "
1924
- cont1:
1925
-
1926
- ; data subdirectory should exist
1927
- IfFileExists " $0\data\*.*" cont2
1817
+ ; models\gta3.img should exist
1818
+ ${IfNot} ${FileExists} " $0\models\gta3.img"
1928
1819
StrCpy $1 " "
1929
- cont2:
1820
+ ${EndIf}
1930
1821
1931
1822
Push $1
1932
1823
FunctionEnd
0 commit comments