From 6d5afa74f277e39e1be30712baaa7dc716ec591e Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 19 Jun 2019 19:42:27 +0000 Subject: [PATCH] Some changes to support Nmap OEM silent installer --- mswin32/nsis/Nmap.nsi.in | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/mswin32/nsis/Nmap.nsi.in b/mswin32/nsis/Nmap.nsi.in index d0ba80ba4..20c924aa0 100644 --- a/mswin32/nsis/Nmap.nsi.in +++ b/mswin32/nsis/Nmap.nsi.in @@ -25,6 +25,10 @@ !error "Need to use large strings build of NSIS." !endif +!ifdef NMAP_OEM +!include "..\..\..\nmap-build\nmap-oem.nsh" +!endif + ;-------------------------------- ;Include Modern UI @@ -259,18 +263,15 @@ Section "Register Nmap Path" SecRegisterPath SectionEnd Section "Npcap @@NPCAP_VERSION@@" SecNpcap +!ifdef NMAP_OEM + !insertmacro NPCAP_OEM_INSTALL "npcap-@@NPCAP_VERSION@@-oem.exe" +!else SetOutPath "$INSTDIR" SetOverwrite on - File ..\npcap-@@NPCAP_VERSION@@-oem.exe - ; If the Nmap installer was launched using /S then pass some arguments to Npcap - IfSilent npcap_silent npcap_loud - npcap_silent: - ExecWait '"$INSTDIR\npcap-@@NPCAP_VERSION@@-oem.exe" /S /winpcap_mode=no' - Goto delete_npcap - npcap_loud: - ExecWait '"$INSTDIR\npcap-@@NPCAP_VERSION@@-oem.exe" /winpcap_mode=no' - delete_npcap: - Delete "$INSTDIR\npcap-@@NPCAP_VERSION@@-oem.exe" + File "..\npcap-@@NPCAP_VERSION@@.exe" + ExecWait '"$INSTDIR\npcap-@@NPCAP_VERSION@@.exe" /winpcap_mode=no' + Delete "$INSTDIR\npcap-@@NPCAP_VERSION@@.exe" +!endif SectionEnd Section "Network Performance Improvements" SecPerfRegistryMods @@ -450,6 +451,10 @@ Function .onInit Quit ; just bail out quickly when running the "inner" installer !endif +!ifndef NMAP_OEM + SetSilent normal +!endif + !insertmacro MUI_INSTALLOPTIONS_EXTRACT "shortcuts.ini" !insertmacro MUI_INSTALLOPTIONS_EXTRACT "final.ini"