DXGL r829 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r828‎ | r829 | r830 >
Date:20:58, 4 July 2018
Author:admin
Status:new
Tags:
Comment:
Visual C++ 2017.7 runtime support in installer
Modified paths:
  • /Installer/dxgl.nsi (modified) (history)
  • /buildtool/buildtool.c (modified) (history)

Diff [purge]

Index: Installer/dxgl.nsi
@@ -24,6 +24,7 @@
2525
2626 !include 'WinVer.nsh'
2727 !include 'LogicLib.nsh'
 28+!include "WordFunc.nsh"
2829 !include 'x64.nsh'
2930
3031 ; HM NIS Edit Wizard helper defines
@@ -35,13 +36,20 @@
3637 !define PRODUCT_UNINST_ROOT_KEY "HKLM"
3738 !include "..\common\version.nsh"
3839
 40+!if ${COMPILER} == "VC2017_7"
3941 !ifdef _DEBUG
 42+!define SRCDIR "Debug VS2017"
 43+!else
 44+!define SRCDIR "Release VS2017"
 45+!endif
 46+!else
 47+!ifdef _DEBUG
4048 !define SRCDIR "Debug"
4149 !else
4250 !define SRCDIR "Release"
4351 !endif
 52+!endif
4453
45 -
4654 ; MUI2
4755 !include "MUI2.nsh"
4856
@@ -101,6 +109,15 @@
102110 !define runtime_sha512 "729251371ED208898430040FE48CABD286A5671BD7F472A30E9021B68F73B2D49D85A0879920232426B139520F7E21321BA92646985216BF2F733C64E014A71D"
103111 !define runtime_regkey SOFTWARE\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum
104112 !define runtime_regvalue Install
 113+!else if ${COMPILER} == "VC2017_7"
 114+!define download_runtime 1
 115+!define runtime_url http://www.dxgl.info/download/runtimes/vc14.14/vc_redist.x86.exe
 116+!define runtime_name "Visual C++ 2017.7"
 117+!define runtime_filename "vc_redist.x86.exe"
 118+!define runtime_sha512 "9D954611243942F4AF6CE37D531EA67CB88CA8CFE5BBE7942606AF11577B12F250F3A9622255760B8BF0610EE72C647BAF42BCCC1F708D3EA05B63B6945DEB8F"
 119+!define runtime_regkey SOFTWARE\Microsoft\DevDiv\vc\Servicing\14.0\RuntimeMinimum
 120+!define runtime_regvalue Install
 121+!define runtime_regvalue2 Version
105122 !else
106123 !define download_runtime 0
107124 !endif
@@ -257,8 +274,25 @@
258275 !else
259276 !if ${download_runtime} >= 1
260277 ReadRegDWORD $0 HKLM ${runtime_regkey} ${runtime_regvalue}
 278+ !if ${COMPILER} == "VC2017_7"
 279+ StrCmp $0 1 skipvcredist1
 280+ goto vcinstall
 281+ skipvcredist1:
 282+ ReadRegDWORD $0 HKLM ${runtime_regkey} ${runtime_regvalue2}
 283+ ${VersionCompare} "$0" "14.14.26429" $1
 284+ ${If} $1 == 0
 285+ SectionSetFlags ${SEC_VCREDIST} 0
 286+ SectionSetText ${SEC_VCREDIST} ""
 287+ ${EndIf}
 288+ ${If} $1 == 1
 289+ SectionSetFlags ${SEC_VCREDIST} 0
 290+ SectionSetText ${SEC_VCREDIST} ""
 291+ ${EndIf}
 292+ goto vcinstall
 293+ !else
261294 StrCmp $0 1 skipvcredist
262295 goto vcinstall
 296+ !endif
263297 skipvcredist:
264298 SectionSetFlags ${SEC_VCREDIST} 0
265299 SectionSetText ${SEC_VCREDIST} ""
Index: buildtool/buildtool.c
@@ -216,6 +216,8 @@
217217 strncpy(findptr, "\"VC2010\"\n", 13);
218218 #elif (_MSC_VER == 1800)
219219 strncpy(findptr, "\"VC2013\"\n", 13);
 220+ #elif (_MSC_VER == 1914)
 221+ strncpy(findptr, "\"VC2017_7\"\n", 13);
220222 #else
221223 strncpy(findptr, "\"UNKNOWN\"\n", 13);
222224 #endif