Skip to content

Commit

Permalink
Merge final changes to support VS2013 build
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bonsaiviking committed Jan 17, 2015
1 parent 563498f commit 0952bed
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 41 deletions.
4 changes: 3 additions & 1 deletion libdnet-stripped/libdnet-stripped.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -20,10 +20,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
4 changes: 3 additions & 1 deletion liblinear/liblinear.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand Down Expand Up @@ -34,12 +34,14 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
4 changes: 3 additions & 1 deletion liblua/liblua.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -20,10 +20,12 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
4 changes: 3 additions & 1 deletion libnetutil/libnetutil.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -20,10 +20,12 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
4 changes: 3 additions & 1 deletion libpcre/libpcre.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -18,10 +18,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
2 changes: 1 addition & 1 deletion mswin32/Makefile
Original file line number Diff line number Diff line change
@@ -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 '.' ',')
Expand Down
7 changes: 5 additions & 2 deletions mswin32/nmap.sln
Original file line number Diff line number Diff line change
@@ -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}
Expand Down Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions mswin32/nmap.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -19,11 +19,13 @@
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down Expand Up @@ -69,6 +71,7 @@
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>CompileAsCpp</CompileAs>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<ShowIncludes>false</ShowIncludes>
</ClCompile>
<Link>
<AdditionalDependencies>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</AdditionalDependencies>
Expand Down Expand Up @@ -342,4 +345,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
40 changes: 20 additions & 20 deletions mswin32/nsis/Nmap.nsi.in
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ SetCompressor /SOLID /FINAL lzma

Var zenmapset
Var addremoveset
Var vcredist2010set
Var vcredist2013set
Var vcredist2008set

;--------------------------------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -286,53 +286,53 @@ Section "Nping (Packet generator)" SecNping
SetOutPath "$INSTDIR"
SetOverwrite on
File ..\nmap-${VERSION}\nping.exe
Call vcredist2010installer
Call vcredist2013installer
Call create_uninstaller
SectionEnd

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

Expand Down Expand Up @@ -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."
Expand Down
5 changes: 4 additions & 1 deletion nbase/nbase.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -23,14 +23,17 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
5 changes: 4 additions & 1 deletion ncat/ncat.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http:https://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
Expand All @@ -23,16 +23,19 @@
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Static|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down

0 comments on commit 0952bed

Please sign in to comment.