Skip to content

Commit 2f89520

Browse files
committed
Added VC2015 redist to installer
1 parent ed6b43a commit 2f89520

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

Shared/installer/nightly.nsi

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
!include WinVer.nsh
99
!include nsArray.nsh
1010
!include Utils.nsh
11+
!include WordFunc.nsh
1112

1213
XPStyle on
1314
RequestExecutionLevel user
@@ -1129,6 +1130,10 @@ Function UpdateVCRedistributables
11291130
${If} $0 != "1"
11301131
Call InstallVC12Redistributable
11311132
${EndIf}
1133+
Call IsVC14RedistributableInstalled
1134+
${If} $0 != "1"
1135+
Call InstallVC14Redistributable
1136+
${EndIf}
11321137
FunctionEnd
11331138

11341139

@@ -1181,6 +1186,67 @@ Function IsVC12RedistributableInstalled
11811186
FunctionEnd
11821187

11831188

1189+
;====================================================================================
1190+
; Download and install Microsoft Visual Studio 2015 redistributable
1191+
;====================================================================================
1192+
!define VC14_REDIST_VER "14.0.23918" ; Version number of update 2
1193+
Var REDISTVC14
1194+
1195+
LangString MSGBOX_VC14RED_ERROR1 ${LANG_ENGLISH} "Unable to download Microsoft Visual Studio 2015 redistributable"
1196+
LangString MSGBOX_VC14RED_ERROR2 ${LANG_ENGLISH} "Unable to install Microsoft Visual Studio 2015 redistributable"
1197+
LangString MSGBOX_VC14RED_ERROR3 ${LANG_ENGLISH} "Unable to download Microsoft Visual Studio 2015 redistributable.\
1198+
$\r$\nHowever installation will continue.\
1199+
$\r$\nPlease reinstall if there are problems later."
1200+
Function InstallVC14Redistributable
1201+
${LogText} "Function begin - InstallVC14Redistributable"
1202+
DetailPrint "Installing Microsoft Visual Studio 2015 redistributable ..."
1203+
StrCpy $REDISTVC14 "$TEMP\vcredist14_x86.exe"
1204+
NSISdl::download "http://download.microsoft.com/download/0/5/0/0504B211-6090-48B1-8DEE-3FF879C29968/vc_redist.x86.exe" $REDISTVC14
1205+
Pop $0
1206+
1207+
${If} $0 != "success"
1208+
DetailPrint "* Download of Microsoft Visual Studio 2015 redistributable failed:"
1209+
DetailPrint "* $0"
1210+
DetailPrint "* Installation continuing anyway"
1211+
MessageBox MB_ICONSTOP "$(MSGBOX_VC14RED_ERROR3)"
1212+
${Else}
1213+
; /passive = 'This option will display a progress dialog (but requires no user interaction) and perform an install.'
1214+
; /quiet = 'This option will suppress all UI and perform an install.'
1215+
ExecWait '"$REDISTVC14" /quiet'
1216+
Call IsVC14RedistributableInstalled
1217+
${If} $0 != "1"
1218+
DetailPrint "* Some error occured installing Microsoft Visual Studio 2015 redistributable"
1219+
DetailPrint "* It is required in order to run Multi Theft Auto : San Andreas"
1220+
DetailPrint "* Installation continuing anyway"
1221+
MessageBox MB_ICONSTOP "$(MSGBOX_VC14RED_ERROR2)"
1222+
MessageBox MB_ICONSTOP "$(MSGBOX_VC14RED_ERROR3)"
1223+
${EndIf}
1224+
${EndIf}
1225+
1226+
${LogText} "Function end - InstallVC14Redistributable"
1227+
FunctionEnd
1228+
1229+
;----------------------------------------
1230+
; Out $0 = result ("1" = yes, "0" = no)
1231+
Function IsVC14RedistributableInstalled
1232+
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\DevDiv\vc\Servicing\14.0\RuntimeMinimum" "Install"
1233+
${If} $0 == "1"
1234+
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\DevDiv\vc\Servicing\14.0\RuntimeMinimum" "Version"
1235+
1236+
; ${VersionCompare} "[Version1]" "[Version2]" $result
1237+
; 0 = Versions are equal
1238+
; 1 = Version1 is newer
1239+
; 2 = Version2 is newer
1240+
${VersionCompare} $0 ${VC14_REDIST_VER} $1
1241+
${If} $1 != "2" ; Version2 is not newer
1242+
StrCpy $0 "1"
1243+
Return
1244+
${EndIf}
1245+
1246+
${EndIf}
1247+
StrCpy $0 "0"
1248+
FunctionEnd
1249+
11841250
;====================================================================================
11851251
; Patcher related functions
11861252
;====================================================================================

0 commit comments

Comments
 (0)