From 0952bed03234828770912a7327260261662ffeb7 Mon Sep 17 00:00:00 2001 From: dmiller Date: Sat, 17 Jan 2015 04:35:01 +0000 Subject: [PATCH] Merge final changes to support VS2013 build Changes: * Fix a collision of the name PS_NONE with a different constant in shlobj.h * Update solution and project files for VS2013 * Update the NSIS installer to reference the VC 2013 redistributable --- libdnet-stripped/libdnet-stripped.vcxproj | 4 ++- liblinear/liblinear.vcxproj | 4 ++- liblua/liblua.vcxproj | 4 ++- libnetutil/libnetutil.vcxproj | 4 ++- libpcre/libpcre.vcxproj | 4 ++- mswin32/Makefile | 2 +- mswin32/nmap.sln | 7 ++-- mswin32/nmap.vcxproj | 7 ++-- mswin32/nsis/Nmap.nsi.in | 40 +++++++++++------------ nbase/nbase.vcxproj | 5 ++- ncat/ncat.vcxproj | 5 ++- nmap-update/nmap-update.vcxproj | 14 ++++---- nmap.cc | 2 ++ nping/nping.vcxproj | 4 ++- nsock/nsock.vcxproj | 9 +++-- 15 files changed, 74 insertions(+), 41 deletions(-) diff --git a/libdnet-stripped/libdnet-stripped.vcxproj b/libdnet-stripped/libdnet-stripped.vcxproj index 4b07e29038..6dc2f6327c 100755 --- a/libdnet-stripped/libdnet-stripped.vcxproj +++ b/libdnet-stripped/libdnet-stripped.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,10 +20,12 @@ StaticLibrary MultiByte + v120 StaticLibrary MultiByte + v120 diff --git a/liblinear/liblinear.vcxproj b/liblinear/liblinear.vcxproj index b4c195d458..54949b9db7 100755 --- a/liblinear/liblinear.vcxproj +++ b/liblinear/liblinear.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -34,12 +34,14 @@ StaticLibrary true Unicode + v120 StaticLibrary false true Unicode + v120 diff --git a/liblua/liblua.vcxproj b/liblua/liblua.vcxproj index b34d0e64fa..42ab92b900 100644 --- a/liblua/liblua.vcxproj +++ b/liblua/liblua.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,10 +20,12 @@ StaticLibrary NotSet true + v120 StaticLibrary NotSet + v120 diff --git a/libnetutil/libnetutil.vcxproj b/libnetutil/libnetutil.vcxproj index 436e0f6195..cf54ac1be3 100644 --- a/libnetutil/libnetutil.vcxproj +++ b/libnetutil/libnetutil.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -20,10 +20,12 @@ StaticLibrary Unicode true + v120 StaticLibrary Unicode + v120 diff --git a/libpcre/libpcre.vcxproj b/libpcre/libpcre.vcxproj index e42b0d52fb..8814c82871 100644 --- a/libpcre/libpcre.vcxproj +++ b/libpcre/libpcre.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -18,10 +18,12 @@ StaticLibrary MultiByte + v120 StaticLibrary MultiByte + v120 diff --git a/mswin32/Makefile b/mswin32/Makefile index a070dc4f4a..09fbb2e890 100644 --- a/mswin32/Makefile +++ b/mswin32/Makefile @@ -1,5 +1,5 @@ MAKENSIS="/cygdrive/c/Program Files/NSIS/makensis.exe" -VCEXPRESS := $(shell reg query "HKEY_CLASSES_ROOT\\Applications\\VCExpress.exe\\shell\\edit\\command" | egrep -i '[A-Z]:\\' | cut -d\" -f2 | sed 's%\\%/%g' | tr -d '\n') +VCEXPRESS := $(shell reg query "HKEY_CLASSES_ROOT\\Applications\\devenv.exe\\shell\\edit\\command" | egrep -i '[A-Z]:\\' | cut -d\" -f2 | sed 's%\\%/%g' | tr -d '\n') export NMAP_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_VERSION' ../nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q') export NMAP_NUM_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_NUM_VERSION' ../nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q') COMMA_VERSION=$(shell echo $(NMAP_NUM_VERSION) | tr '.' ',') diff --git a/mswin32/nmap.sln b/mswin32/nmap.sln index 59a99c42b0..41c3caa6d1 100644 --- a/mswin32/nmap.sln +++ b/mswin32/nmap.sln @@ -1,5 +1,7 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nmap", "nmap.vcxproj", "{361719F0-AB42-4C93-9DE8-7D2144B96625}" ProjectSection(ProjectDependencies) = postProject {99157C3F-39F6-4663-99D7-1D9C1484494E} = {99157C3F-39F6-4663-99D7-1D9C1484494E} @@ -90,6 +92,7 @@ Global {BBF27339-C7B6-4F52-B742-897796C1F13B}.Debug|Win32.ActiveCfg = Debug|Win32 {BBF27339-C7B6-4F52-B742-897796C1F13B}.Debug|Win32.Build.0 = Debug|Win32 {BBF27339-C7B6-4F52-B742-897796C1F13B}.Ncat Static|Win32.ActiveCfg = Release|Win32 + {BBF27339-C7B6-4F52-B742-897796C1F13B}.Ncat Static|Win32.Build.0 = Release|Win32 {BBF27339-C7B6-4F52-B742-897796C1F13B}.Release|Win32.ActiveCfg = Release|Win32 {BBF27339-C7B6-4F52-B742-897796C1F13B}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection diff --git a/mswin32/nmap.vcxproj b/mswin32/nmap.vcxproj index a5ed424b92..a9de960804 100644 --- a/mswin32/nmap.vcxproj +++ b/mswin32/nmap.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -19,11 +19,13 @@ Application false MultiByte + v120 Application false MultiByte + v120 @@ -69,6 +71,7 @@ EditAndContinue CompileAsCpp MultiThreadedDebugDLL + false liblua.lib;nsock.lib;libpcre.lib;nbase.lib;libdnet-stripped.lib;liblinear.lib;ws2_32.lib;IPHlpAPI.Lib;wpcap.lib;packet.lib;advapi32.lib;libeay32.lib;ssleay32.lib;shell32.lib;libnetutil.lib @@ -342,4 +345,4 @@ - + \ No newline at end of file diff --git a/mswin32/nsis/Nmap.nsi.in b/mswin32/nsis/Nmap.nsi.in index ac75c2afd3..0e39fc6072 100644 --- a/mswin32/nsis/Nmap.nsi.in +++ b/mswin32/nsis/Nmap.nsi.in @@ -89,7 +89,7 @@ SetCompressor /SOLID /FINAL lzma Var zenmapset Var addremoveset -Var vcredist2010set +Var vcredist2013set Var vcredist2008set ;-------------------------------- @@ -209,7 +209,7 @@ Section "Nmap Core Files" SecCore ;Store installation folder WriteRegStr HKCU "Software\Nmap" "" $INSTDIR - Call vcredist2010installer + Call vcredist2013installer Call create_uninstaller SectionEnd @@ -267,7 +267,7 @@ Section "Ncat (Modern Netcat reincarnation)" SecNcat SetOverwrite on File ..\nmap-${VERSION}\ncat.exe File ..\nmap-${VERSION}\ca-bundle.crt - Call vcredist2010installer + Call vcredist2013installer Call create_uninstaller SectionEnd @@ -286,7 +286,7 @@ Section "Nping (Packet generator)" SecNping SetOutPath "$INSTDIR" SetOverwrite on File ..\nmap-${VERSION}\nping.exe - Call vcredist2010installer + Call vcredist2013installer Call create_uninstaller SectionEnd @@ -294,45 +294,45 @@ Section "nmap-update (updater for architecture-independent files)" SecNmapUpdate SetOutPath "$INSTDIR" SetOverwrite on File ..\nmap-${VERSION}\nmap-update.exe - Call vcredist2010installer + Call vcredist2013installer Call create_uninstaller SectionEnd -Function vcredist2010installer - StrCmp $vcredist2010set "" 0 vcredist_done - StrCpy $vcredist2010set "true" - ;Check if VC++ 2010 runtimes are already installed. +Function vcredist2013installer + StrCmp $vcredist2013set "" 0 vcredist_done + StrCpy $vcredist2013set "true" + ;Check if VC++ 2013 runtimes are already installed. ;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++ 2010 redistributables have been installed. On x64 systems we need to check + ;one we may be about to install) of the VC++ 2013 redistributables have been installed. On x64 systems we need to check ;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. - ReadRegStr $0 HKLM "SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" "Installed" + ReadRegStr $0 HKLM "SOFTWARE\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install" StrCmp $0 "1" vcredist_done vcredist_check_wow6432node vcredist_check_wow6432node: - ReadRegStr $0 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" "Installed" + ReadRegStr $0 HKLM "SOFTWARE\Wow6432Node\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install" StrCmp $0 "1" vcredist_done vcredist_silent_install - ;If VC++ 2010 runtimes are not installed... + ;If VC++ 2013 runtimes are not installed... vcredist_silent_install: - DetailPrint "Installing Microsoft Visual C++ 2010 Redistributable" + DetailPrint "Installing Microsoft Visual C++ 2013 Redistributable" File ..\nmap-${VERSION}\vcredist_x86.exe ExecWait '"$INSTDIR\vcredist_x86.exe" /q' $0 ;Check for successful installation of our vcredist_x86.exe... - ReadRegStr $0 HKLM "SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" "Installed" + ReadRegStr $0 HKLM "SOFTWARE\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install" StrCmp $0 "1" vcredist_success vcredist_not_present_check_wow6432node vcredist_not_present_check_wow6432node: - ReadRegStr $0 HKLM "SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\VC\VCRedist\x86" "Installed" + ReadRegStr $0 HKLM "SOFTWARE\Wow6432Node\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install" StrCmp $0 "1" vcredist_success vcredist_not_present vcredist_not_present: - DetailPrint "Microsoft Visual C++ 2010 Redistributable failed to install" + DetailPrint "Microsoft Visual C++ 2013 Redistributable failed to install" IfSilent vcredist_done vcredist_messagebox vcredist_messagebox: - MessageBox MB_OK "Microsoft Visual C++ 2010 Redistributable Package (x86) failed to install ($INSTDIR\vcredist_x86.exe). Please ensure your system meets the minimum requirements before running the installer again." + MessageBox MB_OK "Microsoft Visual C++ 2013 Redistributable Package (x86) failed to install ($INSTDIR\vcredist_x86.exe). Please ensure your system meets the minimum requirements before running the installer again." Goto vcredist_done vcredist_success: Delete "$INSTDIR\vcredist_x86.exe" - DetailPrint "Microsoft Visual C++ 2010 Redistributable was successfully installed" + DetailPrint "Microsoft Visual C++ 2013 Redistributable was successfully installed" vcredist_done: FunctionEnd @@ -420,7 +420,7 @@ FunctionEnd ;Descriptions ;Component strings - LangString DESC_SecCore ${LANG_ENGLISH} "Installs Nmap executable, NSE scripts and Visual C++ 2010 runtime components" + LangString DESC_SecCore ${LANG_ENGLISH} "Installs Nmap executable, NSE scripts and Visual C++ 2013 runtime components" LangString DESC_SecRegisterPath ${LANG_ENGLISH} "Registers Nmap path to System path so you can execute it from any directory" LangString DESC_SecWinPcap ${LANG_ENGLISH} "Installs WinPcap 4.1.3 (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." diff --git a/nbase/nbase.vcxproj b/nbase/nbase.vcxproj index 401d98c1ad..edc23eddc8 100644 --- a/nbase/nbase.vcxproj +++ b/nbase/nbase.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -23,14 +23,17 @@ StaticLibrary MultiByte + v120 StaticLibrary MultiByte + v120 StaticLibrary MultiByte + v120 diff --git a/ncat/ncat.vcxproj b/ncat/ncat.vcxproj index 2e773cb751..3e5c4dd736 100644 --- a/ncat/ncat.vcxproj +++ b/ncat/ncat.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -23,16 +23,19 @@ Application false MultiByte + v120 Application false MultiByte + v120 Application false MultiByte + v120 diff --git a/nmap-update/nmap-update.vcxproj b/nmap-update/nmap-update.vcxproj index 7863b07dc3..32ef7b9164 100755 --- a/nmap-update/nmap-update.vcxproj +++ b/nmap-update/nmap-update.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -24,12 +24,14 @@ Application true MultiByte + v120 Application false true MultiByte + v120 @@ -55,14 +57,14 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;APR_DECLARE_STATIC;APU_DECLARE_STATIC;%(PreprocessorDefinitions) ..\nbase;..\..\nmap-mswin32-aux\libsvn\include\apr;..\..\nmap-mswin32-aux\libsvn\include\subversion Console true ..\nbase;..\..\nmap-mswin32-aux\OpenSSL\lib;..\..\nmap-mswin32-aux\libsvn\lib - crypt32.lib;mswsock.lib;rpcrt4.lib;ws2_32.lib;nbase.lib;apr-1.lib;apriconv-1.lib;aprutil-1.lib;libneon.lib;libsvn_fs_fs-1.lib;libsvn_fs_util-1.lib;libsvn_ra_local-1.lib;libsvn_ra_neon-1.lib;libsvn_ra_svn-1.lib;libsvn_client-1.lib;libsvn_delta-1.lib;libsvn_diff-1.lib;libsvn_fs-1.lib;libsvn_ra-1.lib;libsvn_repos-1.lib;libsvn_subr-1.lib;libsvn_wc-1.lib;libeay32.lib;ssleay32.lib;xml.lib;zlib.lib;%(AdditionalDependencies) + version.lib;secur32.lib;crypt32.lib;mswsock.lib;rpcrt4.lib;ws2_32.lib;nbase.lib;apr-1.lib;apriconv-1.lib;aprutil-1.lib;serf-1.lib;libsvn_fs_fs-1.lib;libsvn_fs_util-1.lib;libsvn_ra_local-1.lib;libsvn_ra_serf-1.lib;libsvn_ra_svn-1.lib;libsvn_client-1.lib;libsvn_delta-1.lib;libsvn_diff-1.lib;libsvn_fs-1.lib;libsvn_ra-1.lib;libsvn_repos-1.lib;libsvn_subr-1.lib;libsvn_wc-1.lib;libeay32.lib;ssleay32.lib;xml.lib;zlibstat.lib;%(AdditionalDependencies) @@ -73,7 +75,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;APR_DECLARE_STATIC;APU_DECLARE_STATIC;API_DECLARE_STATIC;%(PreprocessorDefinitions) ..\nbase;..\..\nmap-mswin32-aux\libsvn\include\apr;..\..\nmap-mswin32-aux\libsvn\include\subversion @@ -82,10 +84,10 @@ true true ..\nbase;..\..\nmap-mswin32-aux\OpenSSL\lib;..\..\nmap-mswin32-aux\libsvn\lib - crypt32.lib;mswsock.lib;rpcrt4.lib;ws2_32.lib;nbase.lib;apr-1.lib;apriconv-1.lib;aprutil-1.lib;libneon.lib;libsvn_fs_fs-1.lib;libsvn_fs_util-1.lib;libsvn_ra_local-1.lib;libsvn_ra_neon-1.lib;libsvn_ra_svn-1.lib;libsvn_client-1.lib;libsvn_delta-1.lib;libsvn_diff-1.lib;libsvn_fs-1.lib;libsvn_ra-1.lib;libsvn_repos-1.lib;libsvn_subr-1.lib;libsvn_wc-1.lib;libeay32.lib;ssleay32.lib;xml.lib;zlib.lib;%(AdditionalDependencies) + version.lib;secur32.lib;crypt32.lib;mswsock.lib;rpcrt4.lib;ws2_32.lib;nbase.lib;apr-1.lib;apriconv-1.lib;aprutil-1.lib;serf-1.lib;libsvn_fs_fs-1.lib;libsvn_fs_util-1.lib;libsvn_ra_local-1.lib;libsvn_ra_serf-1.lib;libsvn_ra_svn-1.lib;libsvn_client-1.lib;libsvn_delta-1.lib;libsvn_diff-1.lib;libsvn_fs-1.lib;libsvn_ra-1.lib;libsvn_repos-1.lib;libsvn_subr-1.lib;libsvn_wc-1.lib;libeay32.lib;ssleay32.lib;xml.lib;zlibstat.lib;%(AdditionalDependencies) - \ No newline at end of file + diff --git a/nmap.cc b/nmap.cc index 2fd8f66dfb..edfe4e29c8 100644 --- a/nmap.cc +++ b/nmap.cc @@ -151,6 +151,8 @@ #ifdef WIN32 #include "winfix.h" +/* This name collides in the following include. */ +#undef PS_NONE #include #endif diff --git a/nping/nping.vcxproj b/nping/nping.vcxproj index 09de9598bf..8b9d708d0b 100644 --- a/nping/nping.vcxproj +++ b/nping/nping.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -19,11 +19,13 @@ Application false MultiByte + v120 Application false MultiByte + v120 diff --git a/nsock/nsock.vcxproj b/nsock/nsock.vcxproj index 03ec76b80c..5e4409a0ed 100644 --- a/nsock/nsock.vcxproj +++ b/nsock/nsock.vcxproj @@ -1,5 +1,5 @@  - + DebugNoPcap @@ -31,22 +31,27 @@ StaticLibrary MultiByte + v120 StaticLibrary MultiByte + v120 StaticLibrary MultiByte + v120 StaticLibrary MultiByte + v120 StaticLibrary MultiByte + v120 @@ -227,4 +232,4 @@ - + \ No newline at end of file