Skip to content

Commit

Permalink
Reapply clobbered commit
Browse files Browse the repository at this point in the history
Added "/no_kill" option to uninstaller, if it's set to "yes", uninstaller in Silent mode will abort if any applications are still in use of Npcap.

Conflicts:
	installer/Npcap-for-nmap.nsi
  • Loading branch information
hsluoyz authored and bonsaiviking committed Jan 5, 2017
1 parent fc53545 commit f868b77
Showing 1 changed file with 37 additions and 9 deletions.
46 changes: 37 additions & 9 deletions installer/Npcap-for-nmap.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Var /GLOBAL attestation_signed
Var /GLOBAL cmd_line
Var /GLOBAL service_name

; Installer options:
Var /GLOBAL npf_startup
Var /GLOBAL loopback_support
Var /GLOBAL dlt_null
Expand All @@ -71,7 +72,11 @@ Var /GLOBAL vlan_support
Var /GLOBAL winpcap_mode
Var /GLOBAL sign_mode

; Uninstaller options:
Var /GLOBAL no_confirm
Var /GLOBAL no_kill

; For internal use:
Var /GLOBAL err_flag
Var /GLOBAL cur_system_folder
Var /GLOBAL install_ok
Expand Down Expand Up @@ -323,7 +328,8 @@ FunctionEnd

Function un.getInstallOptions
StrCpy $no_confirm "no"

StrCpy $no_kill "no"

${GetParameters} $cmd_line ; An example: $cmd_line = '/Q'

${GetOptions} $cmd_line "/Q" $R0
Expand All @@ -332,6 +338,12 @@ Function un.getInstallOptions
${Else}
StrCpy $no_confirm "yes"
${EndIf}

${GetOptions} $cmd_line "/no_kill=" $R0
${If} $R0 S== "yes"
${OrIf} $R0 S== "no"
StrCpy $no_kill $R0
${EndIf}
FunctionEnd

; This function is called on startup. IfSilent checks
Expand Down Expand Up @@ -1614,8 +1626,12 @@ Section "Uninstall"
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc' $0
Goto terminate_back_1
${Else}
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc_polite' $0
ExecWait '"$INSTDIR\NPFInstall.exe" -n -d' $0
${If} $no_kill == "no"
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc_polite' $0
ExecWait '"$INSTDIR\NPFInstall.exe" -n -d' $0
${Else}
Goto uninstall_fail
${EndIf}
${EndIf}
${EndIf}
${EndIf}
Expand Down Expand Up @@ -1644,8 +1660,12 @@ Section "Uninstall"
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc' $0
Goto terminate_back_2
${Else}
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc_polite' $0
Call un.remove_win7_XXbit_system_dlls
${If} $no_kill == "no"
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc_polite' $0
Call un.remove_win7_XXbit_system_dlls
${Else}
Goto uninstall_fail
${EndIf}
${EndIf}
${EndIf}

Expand All @@ -1671,8 +1691,12 @@ Section "Uninstall"
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc' $0
Goto terminate_back_3
${Else}
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc_polite' $0
Call un.remove_win7_XXbit_system_dlls
${If} $no_kill == "no"
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc_polite' $0
Call un.remove_win7_XXbit_system_dlls
${Else}
Goto uninstall_fail
${EndIf}
${EndIf}
${EndIf}

Expand All @@ -1697,8 +1721,12 @@ Section "Uninstall"
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc' $0
Goto terminate_back_4
${Else}
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc_polite' $0
Call un.remove_win7_XXbit_system_dlls
${If} $no_kill == "no"
ExecWait '"$INSTDIR\NPFInstall.exe" -n -kill_proc_polite' $0
Call un.remove_win7_XXbit_system_dlls
${Else}
Goto uninstall_fail
${EndIf}
${EndIf}
${EndIf}

Expand Down

0 comments on commit f868b77

Please sign in to comment.