|
8 | 8 | !include WinVer.nsh
|
9 | 9 | !include nsArray.nsh
|
10 | 10 | !include Utils.nsh
|
| 11 | +!include WordFunc.nsh |
11 | 12 |
|
12 | 13 | XPStyle on
|
13 | 14 | RequestExecutionLevel user
|
@@ -1129,6 +1130,10 @@ Function UpdateVCRedistributables
|
1129 | 1130 | ${If} $0 != "1"
|
1130 | 1131 | Call InstallVC12Redistributable
|
1131 | 1132 | ${EndIf}
|
| 1133 | + Call IsVC14RedistributableInstalled |
| 1134 | + ${If} $0 != "1" |
| 1135 | + Call InstallVC14Redistributable |
| 1136 | + ${EndIf} |
1132 | 1137 | FunctionEnd
|
1133 | 1138 |
|
1134 | 1139 |
|
@@ -1181,6 +1186,67 @@ Function IsVC12RedistributableInstalled
|
1181 | 1186 | FunctionEnd
|
1182 | 1187 |
|
1183 | 1188 |
|
| 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 | + |
1184 | 1250 | ;====================================================================================
|
1185 | 1251 | ; Patcher related functions
|
1186 | 1252 | ;====================================================================================
|
|
0 commit comments