Skip to content

Commit

Permalink
[Windows] Updates VC runtime to be compatible with both VS2019 and VS…
Browse files Browse the repository at this point in the history
…2017
  • Loading branch information
thexai committed Apr 21, 2021
1 parent 8adcca2 commit 8e84ab2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
14 changes: 7 additions & 7 deletions project/Win32BuildSetup/genNsisInstaller.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,14 @@ SectionEnd
;vs redist installer Section
SectionGroup "Microsoft Visual C++ packages" SEC_VCREDIST

Section "VS2017 C++ re-distributable Package (${TARGET_ARCHITECTURE})" SEC_VCREDIST1
DetailPrint "Running VS2017 re-distributable setup..."
Section "VS2017-2019 C++ re-distributable Package (${TARGET_ARCHITECTURE})" SEC_VCREDIST1
DetailPrint "Running VS2017-2019 re-distributable setup..."
SectionIn 1 2 #section is in install type Full
SetOutPath "$TEMP\vc2017"
File "${app_root}\..\..\BuildDependencies\downloads\vcredist\2017\vcredist_${TARGET_ARCHITECTURE}.exe"
ExecWait '"$TEMP\vc2017\vcredist_${TARGET_ARCHITECTURE}.exe" /install /quiet /norestart' $VSRedistSetupError
RMDir /r "$TEMP\vc2017"
DetailPrint "Finished VS2017 re-distributable setup"
SetOutPath "$TEMP\vc2019"
File "${app_root}\..\..\BuildDependencies\downloads\vcredist\2017-2019\vcredist_${TARGET_ARCHITECTURE}.exe"
ExecWait '"$TEMP\vc2019\vcredist_${TARGET_ARCHITECTURE}.exe" /install /quiet /norestart' $VSRedistSetupError
RMDir /r "$TEMP\vc2019"
DetailPrint "Finished VS2017-2019 re-distributable setup"
SetOutPath "$INSTDIR"
SectionEnd

Expand Down
15 changes: 7 additions & 8 deletions project/Win32BuildSetup/getdeploydependencies.bat
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
@echo off

REM If KODI_MIRROR is not set externally to this script, set it to the default mirror URL
IF "%KODI_MIRROR%" == "" SET KODI_MIRROR=http://mirrors.kodi.tv
echo Downloading from mirror %KODI_MIRROR%

set DOWNLOAD_URL=https://aka.ms/vs/16/release/vc_redist.%TARGET_ARCHITECTURE%.exe
set DOWNLOAD_FOLDER=..\BuildDependencies\downloads\vcredist\2017-2019
set DOWNLOAD_FILE=vcredist_%TARGET_ARCHITECTURE%.exe

:: Following commands expect this script's parent directory to be the current directory, so make sure that's so
PUSHD %~dp0

if not exist ..\BuildDependencies\downloads\vcredist\2017 mkdir ..\BuildDependencies\downloads\vcredist\2017
if not exist %DOWNLOAD_FOLDER% mkdir %DOWNLOAD_FOLDER%

if not exist ..\BuildDependencies\downloads\vcredist\2017\vcredist_%TARGET_ARCHITECTURE%.exe (
echo Downloading vc141 redist...
..\BuildDependencies\bin\wget --tries=5 --retry-connrefused --waitretry=2 -nv -O ..\BuildDependencies\downloads\vcredist\2017\vcredist_%TARGET_ARCHITECTURE%.exe %KODI_MIRROR%/build-deps/win32/vcredist/2017/vcredist_%TARGET_ARCHITECTURE%.exe
if not exist %DOWNLOAD_FOLDER%\%DOWNLOAD_FILE% (
echo Downloading vc142 redist...
..\BuildDependencies\bin\wget --tries=5 --retry-connrefused --waitretry=2 -nv -O %DOWNLOAD_FOLDER%\%DOWNLOAD_FILE% %DOWNLOAD_URL%
)
:: Restore the previous current directory
POPD

0 comments on commit 8e84ab2

Please sign in to comment.