Skip to content

Commit 8e1ca4e

Browse files
committed
Added exe name variant to the installer
1 parent ceb5698 commit 8e1ca4e

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

Shared/installer/nightly.nsi

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,10 @@ SectionGroup /e "$(INST_SEC_CLIENT)" SECGCLIENT
554554
StrCpy $0 $INSTDIR
555555
Call RemoveVirtualStore
556556

557-
IfFileExists $GTA_DIR\gta_sa.exe +1 0
558-
IfFileExists $GTA_DIR\gta-sa.exe 0 PathBad
557+
Push $GTA_DIR
558+
Call IsGtaDirectory
559+
Pop $0
560+
${If} $0 == "gta"
559561
# Fix permissions for GTA install directory
560562
FastPerms::FullAccessPlox "$GTA_DIR"
561563

@@ -564,10 +566,16 @@ SectionGroup /e "$(INST_SEC_CLIENT)" SECGCLIENT
564566
!insertmacro UAC_AsUser_Call Function RemoveVirtualStore ${UAC_SYNCREGISTERS}
565567
StrCpy $0 $GTA_DIR
566568
Call RemoveVirtualStore
567-
PathBad:
569+
${EndIf}
568570
${EndIf}
569571
#############################################################
570-
572+
573+
# Handle "Grand Theft Auto San Andreas.exe" being present instead of gta_sa.exe
574+
IfFileExists "$GTA_DIR\gta_sa.exe" noCopyReq
575+
IfFileExists "$GTA_DIR\Grand Theft Auto San Andreas.exe" 0 noCopyReq
576+
CopyFiles "$GTA_DIR\Grand Theft Auto San Andreas.exe" "$GTA_DIR\gta_sa.exe"
577+
noCopyReq:
578+
571579
#############################################################
572580
# Patch our San Andreas .exe if it is required
573581
nsArray::SetList array "gta_sa.exe" "gta-sa.exe" "testapp.exe" /end
@@ -577,7 +585,7 @@ SectionGroup /e "$(INST_SEC_CLIENT)" SECGCLIENT
577585
StrCmp "$0" "0" TryNextExe
578586
!insertmacro GetMD5 $GTA_DIR\$1 $ExeMD5
579587
DetailPrint "$1 successfully detected ($ExeMD5)"
580-
${LogText} "GetMD5 $GTA_DIR\gta_sa.exe $ExeMD5"
588+
${LogText} "GetMD5 $GTA_DIR\$1 $ExeMD5"
581589
${Switch} $ExeMD5
582590
${Case} "bf25c28e9f6c13bd2d9e28f151899373" #US 2.00
583591
${Case} "7fd5f9436bd66af716ac584ff32eb483" #US 1.01
@@ -1863,7 +1871,8 @@ Function IsGtaDirectory
18631871
; gta_sa.exe or gta-sa.exe should exist
18641872
IfFileExists "$0\gta_sa.exe" cont1
18651873
IfFileExists "$0\gta-sa.exe" cont1
1866-
StrCpy $1 ""
1874+
IfFileExists "$0\Grand Theft Auto San Andreas.exe" cont1
1875+
StrCpy $1 ""
18671876
cont1:
18681877

18691878
; data subdirectory should exist

0 commit comments

Comments
 (0)