diff --git a/mswin32/Makefile b/mswin32/Makefile index dd9dd15f9..b6392ed11 100644 --- a/mswin32/Makefile +++ b/mswin32/Makefile @@ -7,15 +7,9 @@ LOGLOC=c:nmapbuild.log NSE_FILES = scripts/script.db scripts/*.nse NMAP_MSWIN32_AUX = ../../nmap-mswin32-aux -winbuild: +winbuild: nmap.rc nsis/Nmap.nsi # VCExpress.exe is devenv.com with the commercial Visual Studio suite instead of VC++ Express - @echo "Setting version: $(NMAP_VERSION) ($(NMAP_NUM_VERSION))" - @cat ./nmap.rc | sed 's/VALUE "FileVersion", .*"/VALUE "FileVersion", "$(NMAP_VERSION)\\0"/' > ./nmap.rc.tmp - @cat ./nmap.rc.tmp | sed 's/FILEVERSION .*,.*,.*,.*/FILEVERSION $(COMMA_VERSION)/' > ./nmap.rc - @cat ./nsis/Nmap.nsi | sed 's/VIProductVersion ".*"/VIProductVersion "$(NMAP_NUM_VERSION)"/' > ./nmap.nsi.tmp - @cat ./nmap.nsi.tmp | sed 's/!define VERSION ".*"/!define VERSION "$(NMAP_VERSION)"/' > ./nsis/Nmap.nsi - @rm ./nmap.nsi.tmp ./nmap.rc.tmp @./license-format/licformat.sh ../COPYING > LICENSE "$(VCEXPRESS)" nmap.sln /build release /log $(LOGLOC) @@ -61,6 +55,18 @@ winbuild: $(MAKENSIS) nmap-$(NMAP_VERSION)/Nmap.nsi mv nmap-$(NMAP_VERSION)/NmapInstaller.exe nmap-$(NMAP_VERSION)-setup.exe +nmap.rc: nmap.rc.in + @sed -e '1i// Automatically generated from $<.' \ + -e 's/@@FILEVERSION@@/"$(NMAP_VERSION)\\0"/' \ + -e 's/@@COMMAVERSION@@/$(COMMA_VERSION)/' \ + "$<" > "$@" + +nsis/Nmap.nsi: nsis/Nmap.nsi.in + @sed -e '1i; Automatically generated from $<.' \ + -e 's/@@VIPRODUCTVERSION@@/"$(NMAP_NUM_VERSION)"/' \ + -e 's/@@VERSION@@/"$(NMAP_VERSION)"/' \ + "$<" > "$@" + clean: "$(VCEXPRESS)" nmap.sln /clean - rm -rf Debug Release nmapbuild.log + rm -rf Debug Release nmapbuild.log nmap.rc nsis/Nmap.nsi diff --git a/mswin32/nmap.rc b/mswin32/nmap.rc.in similarity index 93% rename from mswin32/nmap.rc rename to mswin32/nmap.rc.in index d72592de3..e56bfc32a 100644 --- a/mswin32/nmap.rc +++ b/mswin32/nmap.rc.in @@ -12,7 +12,7 @@ // VS_VERSION_INFO VERSIONINFO -FILEVERSION 5,35,0,18 +FILEVERSION @@COMMAVERSION@@ FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x21L @@ -29,7 +29,7 @@ BEGIN BEGIN VALUE "CompanyName", "Insecure.Org\0" VALUE "FileDescription", "Nmap\0" - VALUE "FileVersion", "5.35DC18\0" + VALUE "FileVersion", @@FILEVERSION@@ VALUE "InternalName", "Nmap\0" VALUE "LegalCopyright", "Copyright (c) Insecure.Com LLC (fyodor@insecure.org)\0" VALUE "LegalTrademarks", "NMAP\0" diff --git a/mswin32/nsis/Nmap.nsi b/mswin32/nsis/Nmap.nsi.in similarity index 99% rename from mswin32/nsis/Nmap.nsi rename to mswin32/nsis/Nmap.nsi.in index 2a36a320b..b05442aec 100644 --- a/mswin32/nsis/Nmap.nsi +++ b/mswin32/nsis/Nmap.nsi.in @@ -49,8 +49,8 @@ SetCompressor /SOLID /FINAL lzma ;Get installation folder from registry if available InstallDirRegKey HKCU "Software\Nmap" "" - !define VERSION "6.02" - VIProductVersion "6.02.0.1" + !define VERSION @@VERSION@@ + VIProductVersion @@VIPRODUCTVERSION@@ VIAddVersionKey /LANG=1033 "FileVersion" "${VERSION}" VIAddVersionKey /LANG=1033 "ProductName" "Nmap" VIAddVersionKey /LANG=1033 "CompanyName" "Insecure.org"