Skip to content

Commit

Permalink
Fixed the bug reported by Tenzin Rigden that Npcap installer fails to…
Browse files Browse the repository at this point in the history
… install correct files in /S silent mode.
  • Loading branch information
hsluoyz committed Dec 29, 2015
1 parent e5d18f9 commit f8646a1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
10 changes: 10 additions & 0 deletions installer/Gen_Installer_Only.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: First need to add "makensis.exe" to PATH
:: Generate installer
"C:\Program Files (x86)\NSIS\makensis.exe" .\NPcap-for-nmap.nsi

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Sign the installer
signtool sign /f %NPF_CERT_PATH% /p %NPF_SIGN_PK% .\npcap-nmap-0.05.exe

pause
15 changes: 10 additions & 5 deletions installer/NPcap-for-nmap.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ Function .onInit

do_silent:
SetSilent silent
StrCpy $admin_only "no"
StrCpy $dlt_null "no"
StrCpy $vlan_support "yes"
StrCpy $winpcap_mode "yes"
StrCpy $driver_name "npf"
IfFileExists "$INSTDIR\NPFInstall.exe" silent_checks
return
silent_checks:
Expand Down Expand Up @@ -337,14 +342,14 @@ FunctionEnd
Function doAdminOnlyOptions
ReadINIStr $0 "$PLUGINSDIR\options_admin_only.ini" "Field 1" "State"
${If} $0 == "0"
StrCpy $admin_only "no"
StrCpy $admin_only "no" ; by default
${Else}
StrCpy $admin_only "yes"
${EndIf}

ReadINIStr $0 "$PLUGINSDIR\options_admin_only.ini" "Field 2" "State"
${If} $0 == "0"
StrCpy $dlt_null "no"
StrCpy $dlt_null "no" ; by default
${Else}
StrCpy $dlt_null "yes"
${EndIf}
Expand All @@ -353,16 +358,16 @@ Function doAdminOnlyOptions
${If} $0 == "0"
StrCpy $vlan_support "no"
${Else}
StrCpy $vlan_support "yes"
StrCpy $vlan_support "yes" ; by default
${EndIf}

ReadINIStr $0 "$PLUGINSDIR\options_admin_only.ini" "Field 4" "State"
${If} $0 == "0"
StrCpy $winpcap_mode "no"
StrCpy $driver_name "npcap"
${Else}
StrCpy $winpcap_mode "yes"
StrCpy $driver_name "npf"
StrCpy $winpcap_mode "yes" ; by default
StrCpy $driver_name "npf" ; by default
${EndIf}
FunctionEnd

Expand Down

0 comments on commit f8646a1

Please sign in to comment.