Skip to content

Commit 0e742ef

Browse files
committed
Added VS2013 redist files fixer to installer
1 parent a4fd24f commit 0e742ef

File tree

3 files changed

+49
-5
lines changed

3 files changed

+49
-5
lines changed
Binary file not shown.
Binary file not shown.

Shared/installer/nightly.nsi

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ Var ShowLastUsed
4545
!ifndef FILES_ROOT
4646
!define LIGHTBUILD ; enable LIGHTBUILD for nightly
4747
!define FILES_ROOT "Install files builder/output"
48-
!define SERVER_FILES_ROOT "Install files builder/output/server"
49-
!define FILES_MODULE_SDK "Install files builder/output/development/publicsdk"
48+
!define SERVER_FILES_ROOT "Install files builder/output/MTA San Andreas/server"
49+
!define FILES_MODULE_SDK "Install files builder/output/MTA San Andreas/development/publicsdk"
5050
!define INSTALL_OUTPUT "mtasa-${0.0.0}-unstable-00000-0-000-nsis.exe"
5151
!define PRODUCT_VERSION "v${0.0.0}-unstable-00000-0-000"
5252
!define REVISION "0"
@@ -602,9 +602,9 @@ DontInstallRedistVC12:
602602
!insertmacro GetMD5 $GTA_DIR\$1 $ExeMD5
603603
DetailPrint "$1 successfully detected ($ExeMD5)"
604604
${Switch} $ExeMD5
605-
${Case} "0fd315d1af41e26e536a78b4d4556488" #EU 3.00 Steam
606-
${Case} "2ed36a3cee7b77da86a343838e3516b6" #EU 3.01 Steam (2014 Nov update)
607-
${Case} "5bfd4dd83989a8264de4b8e771f237fd" #EU 3.02 Steam (2014 Dec update)
605+
${Case} "0fd315d1af41e26e536a78b4d4556488" #EU 3.00 Steam 2007-12-04 11:50:50 5697536
606+
${Case} "2ed36a3cee7b77da86a343838e3516b6" #EU 3.01 Steam (2014 Nov update) 2014-10-14 21:58:05 5971456
607+
${Case} "5bfd4dd83989a8264de4b8e771f237fd" #EU 3.02 Steam (2014 Dec update) 2014-12-01 20:43:21 5971456
608608
#Copy gta-sa.exe to gta_sa.exe and commence patching process
609609
CopyFiles "$GTA_DIR\$1" "$GTA_DIR\gta_sa.exe.bak"
610610
Call InstallPatch
@@ -624,6 +624,24 @@ DontInstallRedistVC12:
624624
MessageBox MB_ICONSTOP "$(MSGBOX_INVALID_GTASA)"
625625
CompletePatchProc:
626626

627+
#############################################################
628+
# Fix missing or incorrect VS2013 redist files
629+
SetOutPath $WINDIR\SysWOW64
630+
Push $WINDIR\SysWOW64\msvcp120.dll
631+
Call IsDll32Bit
632+
Pop $0
633+
${If} $0 != 1
634+
File "${FILES_ROOT}\MTA San Andreas\redist\msvcp120.dll"
635+
${EndIf}
636+
637+
Push $WINDIR\SysWOW64\msvcr120.dll
638+
Call IsDll32Bit
639+
Pop $0
640+
${If} $0 != 1
641+
File "${FILES_ROOT}\MTA San Andreas\redist\msvcr120.dll"
642+
${EndIf}
643+
#############################################################
644+
627645
SetOutPath "$INSTDIR\MTA"
628646
SetOverwrite on
629647

@@ -1727,6 +1745,32 @@ Function RemoveVirtualStore
17271745
FunctionEnd
17281746

17291747

1748+
;****************************************************************
1749+
;
1750+
; Returns 1 if file exists and is 32 bit.
1751+
;
1752+
;****************************************************************
1753+
Function IsDll32Bit
1754+
Pop $3
1755+
StrCpy $2 ""
1756+
ClearErrors
1757+
FileOpen $0 $3 r
1758+
IfErrors done
1759+
FileSeek $0 60 ; IMAGE_DOS_HEADER->e_lfanew
1760+
FileReadWord $0 $1
1761+
FileSeek $0 $1 ; IMAGE_NT_HEADERS
1762+
FileSeek $0 4 CUR ; IMAGE_FILE_HEADER->Machine
1763+
FileReadWord $0 $2 ; $2 = Machine
1764+
FileClose $0
1765+
done:
1766+
StrCpy $1 "0"
1767+
${If} $2 == 332 ; 0x014c IMAGE_FILE_MACHINE_I386
1768+
StrCpy $1 "1"
1769+
${EndIf}
1770+
Push $1
1771+
FunctionEnd
1772+
1773+
17301774
;****************************************************************
17311775
;
17321776
; Determine if install/upgrade this version/previous version

0 commit comments

Comments
 (0)