Skip to content
Permalink
Browse files

Bump BIND to 9.13.3

The new version of BIND uses *both* Visual C++ 2012 and 2015
Redistributables, so also update our prerequisite detection.

The following features have been tested:
    * If all required runtimes available:
        * dnssec-keygen works
        * Log includes whether 2012 and 2015 runtimes were detected
    * If not all required runtimes available:
        * Abort with error
        * Error should include URL of one missing runtime
        * Browser should be launched to download that missing runtime
On the following configurations:
    * Windows 7 64-bit, no runtimes
    * Windows 7 64-bit, only 2012 64-bit runtime
    * Windows 7 64-bit, only 2015 64-bit runtime
    * Windows 7 64-bit, 2012 64-bit and 2015 64-bit runtimes
    * Windows 10 32-bit, no runtimes
    * Windows 10 32-bit, only 2012 32-bit runtime
    * Windows 10 32-bit, only 2015 32-bit runtime
    * Windows 10 32-bit, 2012 32-bit and 2015 32-bit runtimes
  • Loading branch information...
JeremyRand committed Oct 27, 2018
1 parent 91763e8 commit e736354e212a9f5798a0543ea2f0eb6b84ca22e1
Showing with 147 additions and 17 deletions.
  1. +8 −1 Makefile
  2. +139 −16 ncdns.nsi
@@ -65,7 +65,14 @@ $(ARTIFACTS)/ncdns.exe: $(ARTIFACTS)/$(NCDNS_ARCFN)

### DNSSEC-KEYGEN
##############################################################################
BINDV=9.13.2
# When bumping the BIND version, make sure to test whether its Visual C++
# dependency has changed version, and change the detection functions in the
# NSIS script accordingly. Also make sure you test both the 32-bit and 64-bit
# versions for bumped Visual C++ dependencies; sometimes they might be bumped
# independently. Also make sure you test for *multiple* Visual C++
# dependencies; sometimes a single program might link against multiple Visual
# C++ dependencies.
BINDV=9.13.3
$(ARTIFACTS)/BIND$(BINDV).$(BINDARCH).zip:
wget -O "$@" "https://ftp.isc.org/isc/bind/$(BINDV)/BIND$(BINDV).$(BINDARCH).zip"

155 ncdns.nsi
@@ -103,6 +103,13 @@ Var /GLOBAL JRE32Detected
Var /GLOBAL JRE64Detected
Var /GLOBAL VC2010_x86_32Detected
Var /GLOBAL VC2010_x86_64Detected
Var /GLOBAL VC2012_x86_32Detected
Var /GLOBAL VC2012_x86_64Detected
Var /GLOBAL VC2015_x86_32Detected
Var /GLOBAL VC2015_x86_64Detected
Var /GLOBAL BindRequirementsMet
Var /GLOBAL BindRequirementsURL
Var /GLOBAL BindRequirementsError
Var /GLOBAL BitcoinJRequirementsMet
Var /GLOBAL BitcoinJRequirementsError

@@ -126,13 +133,19 @@ Function .onInit
Call CheckReinstall

# Detect already installed dependencies.
Call DetectVC8 # aborts on failure
Call DetectNamecoinCore
Call DetectUnbound
Call DetectJRE
Call DetectVC2010_x86_32
Call DetectVC2010_x86_64
Call DetectVC2012_x86_32
Call DetectVC2012_x86_64
Call DetectVC2015_x86_32
Call DetectVC2015_x86_64
Call DetectBindRequirements
Call DetectBitcoinJRequirements

Call FailIfBindRequirementsNotMet
FunctionEnd

Function un.onInit
@@ -149,21 +162,6 @@ Function CheckReinstall

not_installed:
FunctionEnd
Function DetectVC8
# Check that MSVC8 runtime is installed for dnssec-keygen.
FindFirst $0 $1 $WINDIR\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.*
StrCmp $1 "" notfound
Goto found

notfound:
FindClose $0
MessageBox "MB_OK|MB_ICONSTOP" "ncdns for Windows requires the Microsoft Visual C 8.0 runtime.$\n$\nYou can download it from:$\nhttps://www.microsoft.com/en-us/download/details.aspx?id=5638"
ExecShell "open" "https://www.microsoft.com/en-us/download/details.aspx?id=5638"
Abort

found:
FindClose $0
FunctionEnd

Function DetectVC2010_x86_32
# https://blogs.msdn.microsoft.com/astebner/2010/05/05/mailbag-how-to-detect-the-presence-of-the-visual-c-2010-redistributable-package/
@@ -191,6 +189,58 @@ Function DetectVC2010_x86_64
${EndIf}
FunctionEnd

Function DetectVC2012_x86_32
# https://blogs.msdn.microsoft.com/astebner/2010/05/05/mailbag-how-to-detect-the-presence-of-the-visual-c-2010-redistributable-package/
# https://stackoverflow.com/a/34199260
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\VisualStudio\11.0\VC\Runtimes\x86" "Installed"
${If} $0 != "1"
Push 0
Pop $VC2012_x86_32Detected
${Else}
Push 1
Pop $VC2012_x86_32Detected
${EndIf}
FunctionEnd

Function DetectVC2012_x86_64
# https://blogs.msdn.microsoft.com/astebner/2010/05/05/mailbag-how-to-detect-the-presence-of-the-visual-c-2010-redistributable-package/
# https://stackoverflow.com/a/34199260
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\VisualStudio\11.0\VC\Runtimes\x64" "Installed"
${If} $0 != "1"
Push 0
Pop $VC2012_x86_64Detected
${Else}
Push 1
Pop $VC2012_x86_64Detected
${EndIf}
FunctionEnd

Function DetectVC2015_x86_32
# https://blogs.msdn.microsoft.com/astebner/2010/05/05/mailbag-how-to-detect-the-presence-of-the-visual-c-2010-redistributable-package/
# https://stackoverflow.com/a/34199260
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86" "Installed"
${If} $0 != "1"
Push 0
Pop $VC2015_x86_32Detected
${Else}
Push 1
Pop $VC2015_x86_32Detected
${EndIf}
FunctionEnd

Function DetectVC2015_x86_64
# https://blogs.msdn.microsoft.com/astebner/2010/05/05/mailbag-how-to-detect-the-presence-of-the-visual-c-2010-redistributable-package/
# https://stackoverflow.com/a/34199260
ReadRegDWORD $0 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" "Installed"
${If} $0 != "1"
Push 0
Pop $VC2015_x86_64Detected
${Else}
Push 1
Pop $VC2015_x86_64Detected
${EndIf}
FunctionEnd

Function DetectNamecoinCore
ClearErrors
ReadRegStr $0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\Namecoin Core (32-bit)" "UninstallString"
@@ -271,6 +321,55 @@ not_found:
Return
FunctionEnd

Function DetectBindRequirements
# BIND's binaries link against *both* the Visual C++ 2012 and 2015
# Redistributables. Don't ask me why, I don't know.

${If} ${RunningX64}
${If} $VC2012_x86_64Detected == 0
Push 0
Pop $BindRequirementsMet
StrCpy $BindRequirementsURL "https://www.microsoft.com/en-us/download/details.aspx?id=30679"
StrCpy $BindRequirementsError "ncdns for Windows requires the Microsoft Visual C++ 2012 (64-bit) Redistributable.$\n$\nYou can download it from:$\n$BindRequirementsURL"
Return
${EndIf}
${If} $VC2015_x86_64Detected == 0
Push 0
Pop $BindRequirementsMet
StrCpy $BindRequirementsURL "https://www.microsoft.com/en-us/download/details.aspx?id=53587"
StrCpy $BindRequirementsError "ncdns for Windows requires the Microsoft Visual C++ 2015 (64-bit) Redistributable.$\n$\nYou can download it from:$\n$BindRequirementsURL"
Return
${EndIf}
${Else}
${If} $VC2012_x86_32Detected == 0
Push 0
Pop $BindRequirementsMet
StrCpy $BindRequirementsURL "https://www.microsoft.com/en-us/download/details.aspx?id=30679"
StrCpy $BindRequirementsError "ncdns for Windows requires the Microsoft Visual C++ 2012 (32-bit) Redistributable.$\n$\nYou can download it from:$\n$BindRequirementsURL"
Return
${EndIf}
${If} $VC2015_x86_32Detected == 0
Push 0
Pop $BindRequirementsMet
StrCpy $BindRequirementsURL "https://www.microsoft.com/en-us/download/details.aspx?id=53587"
StrCpy $BindRequirementsError "ncdns for Windows requires the Microsoft Visual C++ 2015 (32-bit) Redistributable.$\n$\nYou can download it from:$\n$BindRequirementsURL"
Return
${EndIf}
${EndIf}

Push 1
Pop $BindRequirementsMet
StrCpy $BindRequirementsError ""
FunctionEnd

Function FailIfBindRequirementsNotMet
${If} $BindRequirementsMet == 0
MessageBox "MB_OK|MB_ICONSTOP" "$BindRequirementsError"
ExecShell "open" "$BindRequirementsURL"
Abort
${EndIf}
FunctionEnd

Function DetectBitcoinJRequirements
${If} $JRE64Detected == 1
${If} $VC2010_x86_64Detected == 1
@@ -421,6 +520,30 @@ Function LogRequirementsChecks
DetailPrint "Microsoft Visual C++ 2010 Redistributable Package 64-bit was NOT detected."
${EndIf}

${If} $VC2012_x86_32Detected == 1
DetailPrint "Microsoft Visual C++ 2012 Redistributable Package 32-bit was detected."
${Else}
DetailPrint "Microsoft Visual C++ 2012 Redistributable Package 32-bit was NOT detected."
${EndIf}

${If} $VC2012_x86_64Detected == 1
DetailPrint "Microsoft Visual C++ 2012 Redistributable Package 64-bit was detected."
${Else}
DetailPrint "Microsoft Visual C++ 2012 Redistributable Package 64-bit was NOT detected."
${EndIf}

${If} $VC2015_x86_32Detected == 1
DetailPrint "Microsoft Visual C++ 2015 Redistributable Package 32-bit was detected."
${Else}
DetailPrint "Microsoft Visual C++ 2015 Redistributable Package 32-bit was NOT detected."
${EndIf}

${If} $VC2015_x86_64Detected == 1
DetailPrint "Microsoft Visual C++ 2015 Redistributable Package 64-bit was detected."
${Else}
DetailPrint "Microsoft Visual C++ 2015 Redistributable Package 64-bit was NOT detected."
${EndIf}

${If} $BitcoinJRequirementsMet == 1
DetailPrint "BitcoinJ can be installed."
${Else}

0 comments on commit e736354

Please sign in to comment.
You can’t perform that action at this time.