1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 21:51:28 +00:00

Switch to VC++ 2019 redistributable

This commit is contained in:
dmiller
2021-07-30 22:50:41 +00:00
parent ab35a2eccc
commit 0dc7df9573

View File

@@ -135,7 +135,11 @@ Var zenmapset
Var vcredist2008set Var vcredist2008set
!endif !endif
Var addremoveset Var addremoveset
Var vcredist2013set Var vcredistset
!define NMAP_ARCH x86
!define VCREDISTEXE VC_redist.${NMAP_ARCH}.exe
!define VCREDISTVER 14.0
!define VCREDISTYEAR 2019
;-------------------------------- ;--------------------------------
;Reserves ;Reserves
@@ -260,7 +264,7 @@ Section "Nmap Core Files" SecCore
;Store installation folder ;Store installation folder
WriteRegStr HKCU "Software\${NMAP_NAME}" "" $INSTDIR WriteRegStr HKCU "Software\${NMAP_NAME}" "" $INSTDIR
Call vcredist2013installer Call vcredistinstaller
Call create_uninstaller Call create_uninstaller
SectionEnd SectionEnd
@@ -325,7 +329,7 @@ Section "Ncat (Modern Netcat reincarnation)" SecNcat
SetOverwrite on SetOverwrite on
File ${STAGE_DIR}\ncat.exe File ${STAGE_DIR}\ncat.exe
File ${STAGE_DIR}\ca-bundle.crt File ${STAGE_DIR}\ca-bundle.crt
Call vcredist2013installer Call vcredistinstaller
Call create_uninstaller Call create_uninstaller
SectionEnd SectionEnd
@@ -333,45 +337,38 @@ Section "Nping (Packet generator)" SecNping
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
SetOverwrite on SetOverwrite on
File ${STAGE_DIR}\nping.exe File ${STAGE_DIR}\nping.exe
Call vcredist2013installer Call vcredistinstaller
Call create_uninstaller Call create_uninstaller
SectionEnd SectionEnd
Function vcredist2013installer !macro VCRuntimeInstalled _a _b _t _f
StrCmp $vcredist2013set "" 0 vcredist_done SetRegView 32
StrCpy $vcredist2013set "true" ReadRegStr $0 HKLM "SOFTWARE\Microsoft\VisualStudio\${VCREDISTVER}\VC\Runtimes\${NMAP_ARCH}" "Installed"
;Check if VC++ 2013 runtimes are already installed. StrCmp $0 "1" `${_t}` `${_f}`
!macroend
Function vcredistinstaller
StrCmp $vcredistset "" 0 vcredist_done
StrCpy $vcredistset "true"
;Check if VC++ runtimes are already installed.
;This version creates a registry key that makes it easy to check whether a version (not necessarily the ;This version creates a registry key that makes it easy to check whether a version (not necessarily the
;one we may be about to install) of the VC++ 2013 redistributables have been installed. On x64 systems we need to check ;one we may be about to install) of the VC++ redistributables have been installed.
;the Wow6432Node registry key instead.
;Only run our installer if a version isn't already present, to prevent installing older versions resulting in error messages. ;Only run our installer if a version isn't already present, to prevent installing older versions resulting in error messages.
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install" ;If VC++ runtimes are not installed...
StrCmp $0 "1" vcredist_done vcredist_check_wow6432node ${IfNot} ${VCRedistInstalled}
vcredist_check_wow6432node: DetailPrint "Installing Microsoft Visual C++ ${VCREDISTYEAR} Redistributable"
ReadRegStr $0 HKLM "SOFTWARE\Wow6432Node\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install"
StrCmp $0 "1" vcredist_done vcredist_silent_install
;If VC++ 2013 runtimes are not installed...
vcredist_silent_install:
DetailPrint "Installing Microsoft Visual C++ 2013 Redistributable"
SetOutPath $PLUGINSDIR SetOutPath $PLUGINSDIR
File ${STAGE_DIR}\vcredist_x86.exe File ..\${VCREDISTEXE}
ExecWait '"$PLUGINSDIR\vcredist_x86.exe" /q' $0 ExecWait '"$PLUGINSDIR\${VCREDISTEXE}" /quiet' $0
;Check for successful installation of our vcredist_x86.exe... ;Check for successful installation of our package...
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install" Delete "$PLUGINSDIR\${VCREDISTEXE}"
StrCmp $0 "1" vcredist_success vcredist_not_present_check_wow6432node
vcredist_not_present_check_wow6432node:
ReadRegStr $0 HKLM "SOFTWARE\Wow6432Node\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install"
StrCmp $0 "1" vcredist_success vcredist_not_present
vcredist_not_present: ${IfNot} ${VCRedistInstalled}
DetailPrint "Microsoft Visual C++ 2013 Redistributable failed to install" DetailPrint "Microsoft Visual C++ ${VCREDISTYEAR} Redistributable failed to install"
MessageBox MB_OK "Microsoft Visual C++ 2013 Redistributable Package (x86) failed to install. Please ensure your system meets the minimum requirements before running the installer again." MessageBox MB_OK "Microsoft Visual C++ ${VCREDISTYEAR} Redistributable Package (${NMAP_ARCH}) failed to install. Please ensure your system meets the minimum requirements before running the installer again."
Goto vcredist_done ${Else}
vcredist_success: DetailPrint "Microsoft Visual C++ ${VCREDISTYEAR} Redistributable was successfully installed"
Delete "$PLUGINSDIR\vcredist_x86.exe" ${EndIf}
DetailPrint "Microsoft Visual C++ 2013 Redistributable was successfully installed" ${EndIf}
vcredist_done:
FunctionEnd FunctionEnd
!ifndef NMAP_OEM !ifndef NMAP_OEM
@@ -489,7 +486,7 @@ FunctionEnd
;Descriptions ;Descriptions
;Component strings ;Component strings
LangString DESC_SecCore ${LANG_ENGLISH} "Installs Nmap executable, NSE scripts and Visual C++ 2013 runtime components" LangString DESC_SecCore ${LANG_ENGLISH} "Installs Nmap executable, NSE scripts and Visual C++ ${VCREDISTYEAR} runtime components"
LangString DESC_SecRegisterPath ${LANG_ENGLISH} "Registers Nmap path to System path so you can execute it from any directory" LangString DESC_SecRegisterPath ${LANG_ENGLISH} "Registers Nmap path to System path so you can execute it from any directory"
LangString DESC_SecNpcap ${LANG_ENGLISH} "Installs Npcap ${NPCAP_VERSION} (required for most Nmap scans unless it is already installed)" LangString DESC_SecNpcap ${LANG_ENGLISH} "Installs Npcap ${NPCAP_VERSION} (required for most Nmap scans unless it is already installed)"
LangString DESC_SecPerfRegistryMods ${LANG_ENGLISH} "Modifies Windows registry values to improve TCP connect scan performance. Recommended." LangString DESC_SecPerfRegistryMods ${LANG_ENGLISH} "Modifies Windows registry values to improve TCP connect scan performance. Recommended."