diff -crB vpncfe-0.9.7/install-tap.au3 vpncfe-0.9.8/install-tap.au3
*** vpncfe-0.9.7/install-tap.au3	2009-09-13 23:08:04.000000000 +0200
--- vpncfe-0.9.8/install-tap.au3	2010-10-22 11:37:01.000000000 +0200
***************
*** 18,27 ****
  EndIf
  
  $use_wmi = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "UseWMI")
! If $use_wmi <> 1 Then
! 	$use_wmi = 0
  EndIf
  
  If $CmdLine[1] = "/install" Then
  	_Install()
  ElseIf $CmdLine[1] = "/uninstall" Then
--- 18,33 ----
  EndIf
  
  $use_wmi = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "UseWMI")
! If @error Then
! 	$use_wmi = 1
! 	RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "UseWMI", "REG_DWORD", 1)
! Else
! 	If $use_wmi <> 1 Then
! 		$use_wmi = 0
! 	EndIf
  EndIf
  
+ 
  If $CmdLine[1] = "/install" Then
  	_Install()
  ElseIf $CmdLine[1] = "/uninstall" Then
***************
*** 55,60 ****
--- 61,137 ----
  	FileDelete(@TempDir & "\OemWin2k.inf")
  	FileDelete(@TempDir & "\tap0901.cat")
  	FileDelete(@TempDir & "\tap0901.sys")
+ 
+ ; Automatically rename TAP interfaces
+ 
+  $defIntFr = "Connexion au réseau local"
+  $defIntEn = "Local area network"
+  $IntFR = $defIntFr & " 2"
+  $IntEn = $defIntEn & " 2"
+  $IntIniName = ""
+  $tapind = 0
+  $tapprefix = "tap"
+  $tapver = "TAP-Win32 Adapter V9"
+ 
+ If $use_wmi = 1 Then
+ $strComputer = "."
+  $objWMIService = ObjGet("winmgmts:" _
+     & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
+ 
+  $colItems = $objWMIService.ExecQuery("Select NetConnectionID, Name from Win32_NetworkAdapter where Name like 'TAP-Win32%'")
+  
+ For $objItem in $colItems
+ 	If StringRegExp($objItem.NetConnectionID, "(?i)" & $tapprefix & ".*", 0) Then
+ 		$lasttap = $objItem.NetConnectionID
+ 		StringRegExpReplace ( $lasttap, $tapprefix, "")
+ 		If $lasttap > $tapind Then
+ 			$tapind = $lasttap + 1
+ 		EndIf
+ 	ElseIf StringRegExp($objItem.Name, "(?i)" & $tapver & ".*", 0) Then
+ 		$IntIniName = $objItem.NetConnectionID
+ 	EndIf
+ Next
+ 
+ EndIf
+ 
+ Const $NETWORK_CONNECTIONS = 0x31
+ ;VA  WshShell=Wscript.ObjCreate("Wscript.shell")
+  $objShell = ObjCreate("Shell.Application")
+  $objFolder = $objShell.Namespace($NETWORK_CONNECTIONS)
+  $objFolderItem = $objFolder.Self
+ 
+ $colItems = $objFolder.Items
+ 
+ For $objItem in $colItems
+ If $IntIniName <> "" And $use_wmi = 1 Then
+ 	If $objItem.Name = $IntIniName Then
+ 		$tapname = $tapprefix & $tapind
+ 		$rsres = _RegSearch('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}', $tapname, 4)
+ 		$split = StringSplit($rsres, '=')
+ 		If Not @error Then
+ 			$regname = StringReplace($split[1], '\Connection\Name ', '')
+ 			RegDelete($regname)
+ 		EndIf
+ 		Sleep (2000)
+ 		$objItem.Name = $tapname
+ 		$tapind = $tapind + 1
+ 	EndIf
+ Else		
+ 	If $objItem.Name = $IntFr Or $objItem.Name = $IntEn Then
+ 	$tapname = $tapprefix & $tapind
+ 	$rsres = _RegSearch('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}', $tapname, 4)
+ 	$split = StringSplit($rsres, '=')
+ 	If Not @error Then
+ 		$regname = StringReplace($split[1], '\Connection\Name ', '')
+ 		RegDelete($regname)
+ 	EndIf
+ 	Sleep(2000)	
+ 	$objItem.Name = $tapname
+ 	$tapind = $tapind + 1
+ 	EndIf
+ EndIf
+ Next
+ 	
  EndFunc   ;==>_Install
  
  Func _Uninstall()
***************
*** 116,121 ****
--- 193,204 ----
  	Else
  		RunWait(@ComSpec & ' /c ' & @TempDir & '\tapinstall.exe remove tap0901', @TempDir, @SW_HIDE)
  	EndIf
+ 	$rsres = _RegSearch('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}', $adapter, 4)
+ 	$split = StringSplit($rsres, '=')
+ 	If Not @error Then
+ 		$regname = StringReplace($split[1], '\Connection\Name ', '')
+ 		RegDelete($regname)
+ 	EndIf
  	FileDelete(@TempDir & "\tapinstall.exe")
  EndFunc   ;==>_Uninstall
  
Seulement dans vpncfe-0.9.8: logo.jpg
Seulement dans vpncfe-0.9.8: Plugins
Seulement dans vpncfe-0.9.8: Releases
Seulement dans vpncfe-0.9.8: Unicode
Les fichiers binaires vpncfe-0.9.7/VPNC-dist/bin/cisco-decrypt.exe et vpncfe-0.9.8/VPNC-dist/bin/cisco-decrypt.exe sont différents.
Seulement dans vpncfe-0.9.8/VPNC-dist/bin: cyggcc_s-1.dll
Les fichiers binaires vpncfe-0.9.7/VPNC-dist/bin/cyggcrypt-11.dll et vpncfe-0.9.8/VPNC-dist/bin/cyggcrypt-11.dll sont différents.
Les fichiers binaires vpncfe-0.9.7/VPNC-dist/bin/cyggnutls-26.dll et vpncfe-0.9.8/VPNC-dist/bin/cyggnutls-26.dll sont différents.
Les fichiers binaires vpncfe-0.9.7/VPNC-dist/bin/cyggpg-error-0.dll et vpncfe-0.9.8/VPNC-dist/bin/cyggpg-error-0.dll sont différents.
Les fichiers binaires vpncfe-0.9.7/VPNC-dist/bin/cygiconv-2.dll et vpncfe-0.9.8/VPNC-dist/bin/cygiconv-2.dll sont différents.
Les fichiers binaires vpncfe-0.9.7/VPNC-dist/bin/cygintl-8.dll et vpncfe-0.9.8/VPNC-dist/bin/cygintl-8.dll sont différents.
Les fichiers binaires vpncfe-0.9.7/VPNC-dist/bin/cygtasn1-3.dll et vpncfe-0.9.8/VPNC-dist/bin/cygtasn1-3.dll sont différents.
Les fichiers binaires vpncfe-0.9.7/VPNC-dist/bin/cygwin1.dll et vpncfe-0.9.8/VPNC-dist/bin/cygwin1.dll sont différents.
Seulement dans vpncfe-0.9.8/VPNC-dist/bin: cygwin1.dll-orig
Les fichiers binaires vpncfe-0.9.7/VPNC-dist/bin/cygz.dll et vpncfe-0.9.8/VPNC-dist/bin/cygz.dll sont différents.
Les fichiers binaires vpncfe-0.9.7/VPNC-dist/bin/vpnc.exe et vpncfe-0.9.8/VPNC-dist/bin/vpnc.exe sont différents.
Seulement dans vpncfe-0.9.8/VPNC-dist/etc/vpnc: default.conf
Les fichiers binaires vpncfe-0.9.7/VPNC-dist/etc/vpnc/vpnc-script.exe et vpncfe-0.9.8/VPNC-dist/etc/vpnc/vpnc-script.exe sont différents.
diff -crB vpncfe-0.9.7/vpnc-fe.au3 vpncfe-0.9.8/vpnc-fe.au3
*** vpncfe-0.9.7/vpnc-fe.au3	2009-10-11 08:10:41.000000000 +0200
--- vpncfe-0.9.8/vpnc-fe.au3	2010-10-19 19:11:28.000000000 +0200
***************
*** 5,12 ****
  #AutoIt3Wrapper_Compression=4
  #AutoIt3Wrapper_Res_Comment=Front End to VPNC
  #AutoIt3Wrapper_Res_Description=VPNC Front End
! #AutoIt3Wrapper_Res_Fileversion=0.9.7.0
! #AutoIt3Wrapper_Res_LegalCopyright=© ArchRival Software 2008, 2009
  #AutoIt3Wrapper_Res_Language=1033
  #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
  #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
--- 5,12 ----
  #AutoIt3Wrapper_Compression=4
  #AutoIt3Wrapper_Res_Comment=Front End to VPNC
  #AutoIt3Wrapper_Res_Description=VPNC Front End
! #AutoIt3Wrapper_Res_Fileversion=0.9.8beta
! #AutoIt3Wrapper_Res_LegalCopyright=Free Software Under GPL
  #AutoIt3Wrapper_Res_Language=1033
  #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
  #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
***************
*** 23,28 ****
--- 23,29 ----
  #include <EditConstants.au3>
  #include <Misc.au3>
  #include <WinAPI.au3>
+ #include <SendMessage.au3>
  #include "_check_for_sf_update3.au3"
  #include "_nic_toggle.au3"
  #include "_pcf_2_vpnc.au3"
***************
*** 39,45 ****
  Opt("TrayMenuMode", 1)
  Opt("TrayIconHide", 1)
  
! Global $version = '0.9.7'
  
  Global $connect_start_time
  Global $ipaddress
--- 40,46 ----
  Opt("TrayMenuMode", 1)
  Opt("TrayIconHide", 1)
  
! Global $version = '0.9.8'
  
  Global $connect_start_time
  Global $ipaddress
***************
*** 73,78 ****
--- 74,80 ----
  Global $TwoPhase_Checkbox
  Global $EncPass_Checkbox
  Global $1DES_Checkbox
+ Global $ForceST_Checkbox
  Global $NAT_Combo
  Global $Vendor_Combo
  Global $IKE_Combo
***************
*** 82,87 ****
--- 84,90 ----
  Global $DPD_Idle_Input
  Global $Debug_Input
  Global $Target_Network_Input
+ Global $Local_Network_Input
  Global $Local_Address_Input
  Global $Netmask_Input
  Global $Conn_Edit_GUI
***************
*** 102,107 ****
--- 105,111 ----
  Global $group_pass_obfuscated = 0
  Global $two_phase = 0
  Global $1des = 0
+ Global $fst = 0
  Global $connected_hours
  Global $connected_minutes
  Global $connected_seconds
***************
*** 122,127 ****
--- 126,132 ----
  Global $debug
  Global $local_address
  Global $target_network
+ Global $local_network
  Global $default_authmode = "psk"
  Global $default_vendor = "cisco"
  Global $default_pfs = "server"
***************
*** 133,138 ****
--- 138,144 ----
  Global $default_debug = "0"
  Global $default_local_address = "0.0.0.0"
  Global $default_target_network = "0.0.0.0/0.0.0.0"
+ Global $default_local_network
  Global $enc_passwords
  Global $decrypt_password
  Global $enc_ipsecsecret_sent
***************
*** 152,157 ****
--- 158,164 ----
  Global $postscript_input
  Global $dis_script_input
  
+ 
  If Not IsAdmin() Then
  	; Should not get here on Windows Vista/2008/7
  	MsgBox(16, "VPNC Front End " & $version, "VPNC Front End must run with administrator privileges.")
***************
*** 208,213 ****
--- 215,221 ----
  $use_wmi = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "UseWMI")
  If @error Then
  	$use_wmi = 1
+ 	RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "UseWMI", "REG_DWORD", 1)
  Else
  	If $use_wmi <> 1 Then
  		$use_wmi = 0
***************
*** 608,615 ****
  	EndIf
  
  	If ProcessExists("vpnc.exe") Then
! 		RunWait(@ComSpec & " /c tskill vpnc", $start_dir, @SW_HIDE)
! 		ProcessClose("vpnc.exe")
  	EndIf
  	TraySetIcon("computers.ico")
  	TraySetToolTip("VPNC Front End :: Connecting")
--- 616,625 ----
  	EndIf
  
  	If ProcessExists("vpnc.exe") Then
! 		;RunWait(@ComSpec & " /c tskill vpnc", $start_dir, @SW_HIDE)
! 		;ProcessClose("vpnc.exe")
! 		$handle=WinGetHandle("vpnc.exe")
! 		_SendMessage($handle,$WM_CLOSE)
  	EndIf
  	TraySetIcon("computers.ico")
  	TraySetToolTip("VPNC Front End :: Connecting")
***************
*** 843,852 ****
  EndFunc   ;==>_ConnectVPN
  
  Func _DisconnectVPN()
! 	While ProcessExists("vpnc.exe")
! 		ProcessClose("vpnc.exe")
  		;RunWait(@ComSpec & " /c tskill vpnc", $start_dir, @SW_HIDE)
! 	WEnd
  	FileDelete($start_dir & "\var\run\vpnc\pid")
  	If $vpngateway <> "" Then
  		RunWait(@ComSpec & " /c route delete " & $vpngateway, @ScriptDir, @SW_HIDE)
--- 853,866 ----
  EndFunc   ;==>_ConnectVPN
  
  Func _DisconnectVPN()
! 	Local $vpid
! 	Do
! 		$vpid = ProcessExists("vpnc.exe")
! 		$handle=WinGetHandle("vpnc.exe")
! 		_SendMessage($handle,$WM_CLOSE)
! 		;ProcessClose("vpnc.exe")
  		;RunWait(@ComSpec & " /c tskill vpnc", $start_dir, @SW_HIDE)
! 	Until $vpid = 0
  	FileDelete($start_dir & "\var\run\vpnc\pid")
  	If $vpngateway <> "" Then
  		RunWait(@ComSpec & " /c route delete " & $vpngateway, @ScriptDir, @SW_HIDE)
***************
*** 867,872 ****
--- 881,888 ----
  				If @error Then ExitLoop
  			Until ProcessExists($script_process) = 0 Or _DateDiff('s', $script_start_time, _NowCalc()) > 10
  			StdioClose($script_process)
+ 		;ElseIf $fst = 0
+ 			;RunWait(@ComSpec & ' /c route add 0.0.0.0 mask 0.0.0.0 ' & $defaultroute, $start_dir, @SW_HIDE)
  		EndIf
  	EndIf
  
***************
*** 961,967 ****
  	GUICtrlSetData($NAT_Combo, "", $nat_mode)
  	GUICtrlSetData($NAT_Combo, "NATT|None|Force-NATT|Cisco-UDP", $nat_mode)
  	GUICtrlSetData($Vendor_Combo, "", $vendor)
! 	GUICtrlSetData($Vendor_Combo, "Cisco|NetScreen", $vendor)
  	GUICtrlSetData($IKE_Combo, "", $ike_group)
  	GUICtrlSetData($IKE_Combo, "DH1|DH2|DH5", $ike_group)
  	GUICtrlSetData($PFS_Combo, "", $pfs)
--- 977,983 ----
  	GUICtrlSetData($NAT_Combo, "", $nat_mode)
  	GUICtrlSetData($NAT_Combo, "NATT|None|Force-NATT|Cisco-UDP", $nat_mode)
  	GUICtrlSetData($Vendor_Combo, "", $vendor)
! 	GUICtrlSetData($Vendor_Combo, "Cisco|NetScreen|Juniper", $vendor)
  	GUICtrlSetData($IKE_Combo, "", $ike_group)
  	GUICtrlSetData($IKE_Combo, "DH1|DH2|DH5", $ike_group)
  	GUICtrlSetData($PFS_Combo, "", $pfs)
***************
*** 976,981 ****
--- 992,998 ----
  	GUICtrlSetData($DPD_Idle_Input, $dpd_idle)
  	GUICtrlSetData($Debug_Input, $debug)
  	GUICtrlSetData($Target_Network_Input, $target_network)
+ 	GUICtrlSetData($Local_Network_Input, $local_network)
  	GUICtrlSetData($Local_Address_Input, $local_address)
  
  	If $two_phase = 1 Then
***************
*** 993,998 ****
--- 1010,1020 ----
  	Else
  		GUICtrlSetState($1DES_Checkbox, $GUI_UNCHECKED)
  	EndIf
+ 	If $fst = 1 Then
+ 		GUICtrlSetState($ForceST_Checkbox, $GUI_CHECKED)
+ 	Else
+ 		GUICtrlSetState($ForceST_Checkbox, $GUI_UNCHECKED)
+ 	EndIf
  	If $authmode <> "Hybrid" Then
  		GUICtrlSetState($config_menu_ca_file, $GUI_DISABLE)
  	EndIf
***************
*** 1029,1034 ****
--- 1051,1057 ----
  	$new_twophase = GUICtrlRead($TwoPhase_Checkbox)
  	$new_encpasswords = GUICtrlRead($EncPass_Checkbox)
  	$new_1des = GUICtrlRead($1DES_Checkbox)
+ 	$new_fst = GUICtrlRead($ForceST_Checkbox)	
  	$new_vendor = GUICtrlRead($Vendor_Combo)
  	$new_pfs = GUICtrlRead($PFS_Combo)
  	$new_ike_group = GUICtrlRead($IKE_Combo)
***************
*** 1039,1044 ****
--- 1062,1068 ----
  	$new_debug = GUICtrlRead($Debug_Input)
  	$new_local_address = GUICtrlRead($Local_Address_Input)
  	$new_target_network = GUICtrlRead($Target_Network_Input)
+ 	$new_local_network = GUICtrlRead($Local_Network_Input)
  	$new_default_netmask = GUICtrlRead($Netmask_Input)
  	$save_error_message = ""
  	;$new_ca_file = GUICtrlRead($CA_Input)
***************
*** 1272,1277 ****
--- 1296,1311 ----
  	If Not @error Then
  		RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "DPDIdle")
  	EndIf
+ 	If $new_fst = $GUI_CHECKED Then
+ 		$fst = 1
+ 		If FileWriteLine($file_handle, "Target split tunneling") = -1 Then
+ 			$save_error_message &= "Error writing line to file: " & $full_config_file & @CRLF
+ 			SetError(0)
+ 			Return $save_error_message
+ 		EndIf
+ 	Else
+ 		$fst = 0
+ 	EndIf
  	If $new_1des = $GUI_CHECKED Then
  		$1des = 1
  		If FileWriteLine($file_handle, "Enable Single DES") = -1 Then
***************
*** 1372,1377 ****
--- 1406,1421 ----
  			EndIf
  		EndIf
  	EndIf
+ 		If StringInStr($new_local_network, "/") Then
+ 		$local_split = StringSplit($new_local_network, "/")
+ 		If $local_split[0] = 2 And _IsIPAddress($local_split[1]) And _IsIPAddress($local_split[2]) Then
+ 			If FileWriteLine($file_handle, "IPSEC local network " & $new_local_network) = -1 Then
+ 				$save_error_message &= "Error writing line to file: " & $full_config_file & @CRLF
+ 				SetError(0)
+ 				Return $save_error_message
+ 			EndIf
+ 		EndIf
+ 	EndIf
  	If $new_local_port >=0 And $new_local_port <= 65535 And $new_local_port <> $default_local_port Then
  		If FileWriteLine($file_handle, "Local Port " & $new_local_port) = -1 Then
  			$save_error_message &= "Error writing line to file: " & $full_config_file & @CRLF
***************
*** 1453,1473 ****
  	$PFS_Combo = GUICtrlCreateCombo("", 8, 228, 120, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
  	$Local_Address_Label = GUICtrlCreateLabel("Local Address", 150, 26, 100, 17)
  	$Local_Address_Input = GUICtrlCreateInput("", 150, 44, 120, 21)
! 	$Local_Port_Label = GUICtrlCreateLabel("Local Port", 150, 72, 100, 17)
! 	$Local_Port_Input = GUICtrlCreateInput("", 150, 90, 120, 21, BitOR($ES_NUMBER, $ES_LEFT, $ES_AUTOHSCROLL))
! 	$Target_Network_Label = GUICtrlCreateLabel("Target Network", 150, 118, 120, 17)
! 	$Target_Network_Input = GUICtrlCreateInput("", 150, 136, 260, 21)
! 	$Cisco_UDP_Port_Label = GUICtrlCreateLabel("UDP Encapsulation Port", 150, 164, 170, 17)
! 	$Cisco_UDP_Port_Input = GUICtrlCreateInput("", 150, 182, 120, 21, BitOR($ES_NUMBER, $ES_LEFT, $ES_AUTOHSCROLL))
! 	$DPD_Idle_Label = GUICtrlCreateLabel("DPD Idle Timeout", 150, 210, 120, 17)
! 	$DPD_Idle_Input = GUICtrlCreateInput("", 150, 228, 120, 21, BitOR($ES_NUMBER, $ES_LEFT, $ES_AUTOHSCROLL))
  	$Debug_Label = GUICtrlCreateLabel("Debug Level", 290, 26, 100, 17)
  	$Debug_Input = GUICtrlCreateInput("", 290, 44, 120, 21, BitOR($ES_NUMBER, $ES_LEFT, $ES_AUTOHSCROLL))
! 	$Netmask_Label = GUICtrlCreateLabel("Default Netmask", 290, 164, 170, 17)
! 	$Netmask_Input = GUICtrlCreateInput("", 290, 182, 120, 21)
  	$1DES_Checkbox = GUICtrlCreateCheckbox("Single DES", 290, 72, 80, 17)
  	$TwoPhase_Checkbox = GUICtrlCreateCheckbox("2-Phase Authentication", 290, 92, 130, 17)
  	$EncPass_Checkbox = GUICtrlCreateCheckbox("Encrypt Passwords", 290, 112, 130, 17)
  	GUICtrlCreateGroup("Defaults", 2, 260, 423, 167)
  	GUICtrlCreateLabel("Authentication: PSK", 8, 278, 160, 17)
  	GUICtrlCreateLabel("Vendor: Cisco", 8, 296, 160, 17)
--- 1497,1520 ----
  	$PFS_Combo = GUICtrlCreateCombo("", 8, 228, 120, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
  	$Local_Address_Label = GUICtrlCreateLabel("Local Address", 150, 26, 100, 17)
  	$Local_Address_Input = GUICtrlCreateInput("", 150, 44, 120, 21)
! 	$Local_Port_Label = GUICtrlCreateLabel("Local Port", 150, 118, 120, 17)
! 	$Local_Port_Input = GUICtrlCreateInput("", 150, 136, 130, 21, BitOR($ES_NUMBER, $ES_LEFT, $ES_AUTOHSCROLL))
! 	$Target_Network_Label = GUICtrlCreateLabel("Target Network", 150, 164, 120, 17)
! 	$Target_Network_Input = GUICtrlCreateInput("", 150, 182, 130, 21)
! 	$Local_Network_Label = GUICtrlCreateLabel("Local Network", 150, 210, 120, 17)
! 	$Local_Network_Input = GUICtrlCreateInput("", 150, 228, 130, 21)
! 	$Cisco_UDP_Port_Label = GUICtrlCreateLabel("UDP Encapsulation Port", 290, 164, 170, 17)
! 	$Cisco_UDP_Port_Input = GUICtrlCreateInput("", 290, 182, 120, 21, BitOR($ES_NUMBER, $ES_LEFT, $ES_AUTOHSCROLL))
! 	$DPD_Idle_Label = GUICtrlCreateLabel("DPD Idle Timeout", 290, 210, 170, 17)
! 	$DPD_Idle_Input = GUICtrlCreateInput("", 290, 228, 120, 21, BitOR($ES_NUMBER, $ES_LEFT, $ES_AUTOHSCROLL))
  	$Debug_Label = GUICtrlCreateLabel("Debug Level", 290, 26, 100, 17)
  	$Debug_Input = GUICtrlCreateInput("", 290, 44, 120, 21, BitOR($ES_NUMBER, $ES_LEFT, $ES_AUTOHSCROLL))
! 	$Netmask_Label = GUICtrlCreateLabel("Default Netmask", 150, 72, 100, 17)
! 	$Netmask_Input = GUICtrlCreateInput("", 150, 90, 120, 21)
  	$1DES_Checkbox = GUICtrlCreateCheckbox("Single DES", 290, 72, 80, 17)
  	$TwoPhase_Checkbox = GUICtrlCreateCheckbox("2-Phase Authentication", 290, 92, 130, 17)
  	$EncPass_Checkbox = GUICtrlCreateCheckbox("Encrypt Passwords", 290, 112, 130, 17)
+ 	$ForceST_Checkbox = GUICtrlCreateCheckbox("Target Split Tunneling", 290, 132, 130, 17)
  	GUICtrlCreateGroup("Defaults", 2, 260, 423, 167)
  	GUICtrlCreateLabel("Authentication: PSK", 8, 278, 160, 17)
  	GUICtrlCreateLabel("Vendor: Cisco", 8, 296, 160, 17)
***************
*** 1748,1753 ****
--- 1795,1803 ----
  				If StringLeft($defaultarray[$i], 17) = "Enable Single DES" Then
  					$1des = 1
  				EndIf
+ 				If StringLeft($defaultarray[$i], 22) = "Target split tunneling" Then
+ 					$fst = 1
+ 				EndIf
  				If StringLeft($defaultarray[$i], 6) = "Vendor" Then
  					$vendor = StringTrimLeft($defaultarray[$i], 7)
  				EndIf
***************
*** 1775,1780 ****
--- 1825,1833 ----
  				If StringLeft($defaultarray[$i], 20) = "IPSEC target network" Then
  					$target_network = StringTrimLeft($defaultarray[$i], 21)
  				EndIf
+ 				If StringLeft($defaultarray[$i], 19) = "IPSEC local network" Then
+ 					$local_network = StringTrimLeft($defaultarray[$i], 20)
+ 				EndIf
  			Next
  		EndIf
  	EndIf
Seulement dans vpncfe-0.9.8: vpnc-fe-logo.nsi
diff -crB vpncfe-0.9.7/vpnc-fe.nsi vpncfe-0.9.8/vpnc-fe.nsi
*** vpncfe-0.9.7/vpnc-fe.nsi	2009-10-11 08:24:35.000000000 +0200
--- vpncfe-0.9.8/vpnc-fe.nsi	2010-10-22 18:42:14.000000000 +0200
***************
*** 2,8 ****
  ;--------------------------------
  
  !ifndef VERSION
!   !define VERSION '0.9.7'
  !endif
  
  ;--------------------------------
--- 2,8 ----
  ;--------------------------------
  
  !ifndef VERSION
!   !define VERSION '0.9.8beta'
  !endif
  
  ;--------------------------------
***************
*** 38,43 ****
--- 38,44 ----
  !include "LogicLib.nsh"
  !include "Memento.nsh"
  !include "WordFunc.nsh"
+ !include WinMessages.nsh
  
  ;--------------------------------
  ;Functions
***************
*** 63,75 ****
  !define MEMENTO_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\VPNCFE"
  
  ;Interface Settings
  !define MUI_ABORTWARNING
  
  !define MUI_COMPONENTSPAGE_SMALLDESC
  
  ;Pages
! !define MUI_WELCOMEPAGE_TITLE "Welcome to the VPNC Front End ${VERSION} Setup Wizard"
! !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of VPNC Front End ${VERSION}, a front end to vpnc, a command line utility to connect to Cisco VPN concentrators.$\r$\n$\r$\n$_CLICK"
  
  !insertmacro MUI_PAGE_WELCOME
  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\License\gpl-2.0.txt"
--- 64,79 ----
  !define MEMENTO_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\VPNCFE"
  
  ;Interface Settings
+ !define MUI_HEADERIMAGE
+ !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp"
+ 
  !define MUI_ABORTWARNING
  
  !define MUI_COMPONENTSPAGE_SMALLDESC
  
  ;Pages
! !define MUI_WELCOMEPAGE_TITLE "Welcome to the VPNC Front End ${VERSION} Nateis Special Edition"
! !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of VPNC Front End ${VERSION}, a front end to vpnc, a command line utility to connect to Cisco VPN concentrators, Netscreen SSG and Juniper SRX Firewalls among others... This product was not developed by the companies owning the trademarks herein. This free software is provided *as is* without warranty of any kind under GPL following. VPNC was originally developed by Geoffrey Keating, and as a GPL software, many people contibuted to it. Nateis freely provided SRX support and some other changes for VPNC and its Front End, listed in the ReleaseNotes.txt file.$\r$\n$\r$\n$_CLICK"
  
  !insertmacro MUI_PAGE_WELCOME
  !insertmacro MUI_PAGE_LICENSE "${NSISDIR}\License\gpl-2.0.txt"
***************
*** 118,123 ****
--- 122,128 ----
  
    SetOutPath $INSTDIR\bin
    File VPNC-dist\bin\cisco-decrypt.exe
+   File VPNC-dist\bin\cyggcc_s-1.dll
    File VPNC-dist\bin\cyggcrypt-11.dll
    File VPNC-dist\bin\cyggnutls-26.dll
    File VPNC-dist\bin\cyggpg-error-0.dll
***************
*** 131,136 ****
--- 136,142 ----
  
    SetOutPath $INSTDIR\etc\vpnc
    File VPNC-dist\etc\vpnc\vpnc-script.exe
+   File VPNC-dist\etc\vpnc\default.conf
    
    SetOutPath $INSTDIR\tmp
    
***************
*** 182,188 ****
    SetDetailsPrint listonly
  
    ExecWait '"$INSTDIR\install-tap.exe" /install'
! 
  ${MementoSectionEnd}
  
  ${MementoSectionDone}
--- 188,194 ----
    SetDetailsPrint listonly
  
    ExecWait '"$INSTDIR\install-tap.exe" /install'
!    
  ${MementoSectionEnd}
  
  ${MementoSectionDone}
***************
*** 237,248 ****
  ;--------------------------------
  ;Installer Functions
  
  Function .onInit
  
!   ${MementoSectionRestore}
  
  FunctionEnd
  
  !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  
  Var ReinstallPageCheck
--- 243,258 ----
  ;--------------------------------
  ;Installer Functions
  
+ 
+ 
  Function .onInit
  
! ${MementoSectionRestore}
  
  FunctionEnd
  
+ 
+ 
  !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
  
  Var ReinstallPageCheck
***************
*** 407,412 ****
--- 417,423 ----
    Delete $INSTDIR\etc\vpnc\vpnc-script.exe
    Delete $INSTDIR\bin\cisco-decrypt.exe
    Delete $INSTDIR\bin\cyggcrypt-11.dll
+   Delete $INSTDIR\bin\cyggcc_s-1.dll
    Delete $INSTDIR\bin\cyggnutls-26.dll
    Delete $INSTDIR\bin\cyggpg-error-0.dll
    Delete $INSTDIR\bin\cygiconv-2.dll
diff -crB vpncfe-0.9.7/vpnc-script.au3 vpncfe-0.9.8/vpnc-script.au3
*** vpncfe-0.9.7/vpnc-script.au3	2009-10-11 07:46:43.000000000 +0200
--- vpncfe-0.9.8/vpnc-script.au3	2010-10-22 17:36:11.000000000 +0200
***************
*** 14,19 ****
--- 14,20 ----
  #Include "_ip_vpnc.au3"
  
  Dim $ws
+ Global $itunid = 0
  
  $use_wmi = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "UseWMI")
  If $use_wmi <> 1 Then
***************
*** 25,31 ****
  	$old_gateway = 0
  EndIf
  
! $wait_timeout = 10000
  
  $current_config = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "Config")
  $internal_ip4_netmask = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software\Config\" & StringTrimRight($current_config, 5), "DefaultNetmask")
--- 26,32 ----
  	$old_gateway = 0
  EndIf
  
! $wait_timeout = 30000
  
  $current_config = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "Config")
  $internal_ip4_netmask = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software\Config\" & StringTrimRight($current_config, 5), "DefaultNetmask")
***************
*** 86,91 ****
--- 87,110 ----
  		EndIf
  		ConsoleWrite(@CRLF)
  
+ ; Finds Interface Index
+ 
+ ;MsgBox (1, "Test", " use_wmi : " & $use_wmi & @CRLF)
+ 
+ $intindex = 0
+ If $use_wmi = 1 Then
+ $strComputer = "."
+  $objWMIService = ObjGet("winmgmts:" _
+     & "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
+ 
+  $colItems = $objWMIService.ExecQuery("Select Index from Win32_NetworkAdapter where NetConnectionID = '" & $env("TUNDEV") & "'")
+  
+ 	For $objItem in $colItems
+ 		$intindex = $objItem.Index
+ 	Next
+ EndIf
+ ;MsgBox (1, "Test", " intindex : " & $intindex & @CRLF)
+ 
  		If $old_gateway = 0 Then
  			$gw = getDefaultGateway($env("VPNGATEWAY"))
  		Else
***************
*** 121,138 ****
  		EndIf
  
  		$conscript = FileOpen(@ScriptDir & '\conscript.cmd', 2)
! 		FileWriteLine($conscript, $netshcmd & ' set address "' & $env("TUNDEV") & '" static ' & $env("INTERNAL_IP4_ADDRESS") & ' ' & $internal_ip4_netmask & ' > NUL')
! ;~ 		If $runwait = 1 Then
! ;~ 			RunWait($netshcmd & ' set address "' & $env("TUNDEV") & '" static ' & $env("INTERNAL_IP4_ADDRESS") & ' ' & $internal_ip4_netmask & ' > NUL', @ScriptDir, @SW_HIDE)
! ;~ 		Else
! ;~ 			Run($netshcmd & ' set address "' & $env("TUNDEV") & '" static ' & $env("INTERNAL_IP4_ADDRESS") & ' ' & $internal_ip4_netmask & ' > NUL', @ScriptDir, @SW_HIDE)
! ;~ 		EndIf
  
  		If $env("INTERNAL_IP4_NBNS") Then
  			$wins = StringSplit($env("INTERNAL_IP4_NBNS"), " ")
  			For $i = 1 To $wins[0]
  				ConsoleWrite("Adding WINS entry: " & $wins[$i] & @CRLF)
  				FileWriteLine($conscript, $netshcmd & ' add wins "' & $env("TUNDEV") & '" ' & $wins[$i] & ' index=' & ($i + 1) & ' > NUL')
  				;RunWait($netshcmd & ' add wins "' & $env("TUNDEV") & '" ' & $wins[$i] & ' index=' & ($i + 1) & ' > NUL', @ScriptDir, @SW_HIDE)
  			Next
  		EndIf
--- 140,179 ----
  		EndIf
  
  		$conscript = FileOpen(@ScriptDir & '\conscript.cmd', 2)
! 		
! 		;MsgBox (1, "Test", " runwait : " & $runwait & @CRLF)
! 		
! 		If $runwait = 1 Then
!  			RunWait($netshcmd & ' set address "' & $env("TUNDEV") & '" static ' & $env("INTERNAL_IP4_ADDRESS") & ' ' & $internal_ip4_netmask & ' > NUL', @ScriptDir, @SW_HIDE)
!  		Else
! 			;Sleep (1000)
! 			;Run($netshcmd & ' set address "' & $env("TUNDEV") & '" static ' & $env("INTERNAL_IP4_ADDRESS") & ' ' & $internal_ip4_netmask & ' > NUL', @ScriptDir, @SW_HIDE)
! 			FileWriteLine($conscript, $netshcmd & ' set address "' & $env("TUNDEV") & '" static ' & $env("INTERNAL_IP4_ADDRESS") & ' ' & $internal_ip4_netmask & ' > NUL')
! 			FileFlush ($conscript);
! 				Sleep (1000)
! 			If $use_wmi = 1 Then
! ;				$strComputer = "."
! ;				$objWMIService = ObjGet("winmgmts:" _
! ;					& "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
! 				$colItems = $objWMIService.ExecQuery("Select Description, SettingID, Index from Win32_NetworkAdapterConfiguration where Index = " & $intindex)
! 				For $objItem in $colItems
! 					;MsgBox (1, "Test", " Description : " & $objItem.Description & " SettingID : " & $objItem.SettingID  & " Index : " & $objItem.Index & " intindex : " & $intindex & @CRLF)
! 					$result = $objItem.ReleaseDHCPLease()
! 				Next
! 			Else
! 			; TODO : Find a method using netsh or ReWrite
! 			
! 			EndIf
! 
! 	
! 		EndIf
  
  		If $env("INTERNAL_IP4_NBNS") Then
  			$wins = StringSplit($env("INTERNAL_IP4_NBNS"), " ")
  			For $i = 1 To $wins[0]
  				ConsoleWrite("Adding WINS entry: " & $wins[$i] & @CRLF)
  				FileWriteLine($conscript, $netshcmd & ' add wins "' & $env("TUNDEV") & '" ' & $wins[$i] & ' index=' & ($i + 1) & ' > NUL')
+ 				FileFlush ($conscript);
  				;RunWait($netshcmd & ' add wins "' & $env("TUNDEV") & '" ' & $wins[$i] & ' index=' & ($i + 1) & ' > NUL', @ScriptDir, @SW_HIDE)
  			Next
  		EndIf
***************
*** 142,179 ****
  			For $i = 1 To $dns[0]
  				ConsoleWrite("Adding DNS entry: " & $dns[$i] & @CRLF)
  				FileWriteLine($conscript, $netshcmd & ' add dns "' & $env("TUNDEV") & '" ' & $dns[$i] & ' index=' & ($i + 1) & ' > NUL')
  				;RunWait($netshcmd & ' add dns "' & $env("TUNDEV") & '" ' & $dns[$i] & ' index=' & ($i + 1) & ' > NUL', @ScriptDir, @SW_HIDE)
  			Next
  		EndIf
  
  		$preserve_routes = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "PreserveRoutes")
  
  		; It does not appear adding a route delay is needed any longer
! ;~ 		$route_add_delay = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "RouteDelay")
  
! ;~ 		If Not IsInt($route_add_delay) Then
! ;~ 			$route_add_delay = 4000
! ;~ 		EndIf
! 
! ;~ 		If $route_add_delay > 30000 Then
! ;~ 			$route_add_delay = 30000
! ;~ 		EndIf
! 
! ;~ 		Sleep($route_add_delay)
! 
! 		$wait_start = TimerInit()
! 		While $env("CISCO_SPLIT_INC") <= 0
! 			If TimerDiff($wait_start) > $wait_timeout Then
! 				ExitLoop
  			EndIf
! 			Sleep(10)
! 		WEnd
  
  		If $env("CISCO_SPLIT_INC") Then
! 			If $preserve_routes = 1 Then
! 				ConsoleWrite("Preserving routes" & @CRLF)
! 				$routes = getRoutesList()
! 			EndIf
  			For $i = 0 To $env("CISCO_SPLIT_INC") -1
  				$network = $env("CISCO_SPLIT_INC_" & $i & "_ADDR")
  				$netmask = $env("CISCO_SPLIT_INC_" & $i & "_MASK")
--- 183,233 ----
  			For $i = 1 To $dns[0]
  				ConsoleWrite("Adding DNS entry: " & $dns[$i] & @CRLF)
  				FileWriteLine($conscript, $netshcmd & ' add dns "' & $env("TUNDEV") & '" ' & $dns[$i] & ' index=' & ($i + 1) & ' > NUL')
+ 				FileFlush ($conscript);
  				;RunWait($netshcmd & ' add dns "' & $env("TUNDEV") & '" ' & $dns[$i] & ' index=' & ($i + 1) & ' > NUL', @ScriptDir, @SW_HIDE)
  			Next
  		EndIf
  
+ 
  		$preserve_routes = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "PreserveRoutes")
  
  		; It does not appear adding a route delay is needed any longer
! 		;$route_add_delay = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\ArchRival Software", "RouteDelay")
  
!  		;If Not IsInt($route_add_delay) Then
!  		;	$route_add_delay = 4000
!  		;EndIf
! 
!  		;If $route_add_delay > 30000 Then
!  		;	$route_add_delay = 30000
!  		;EndIf
! 
!  		;Sleep($route_add_delay)
! 		
! 		;$wait_start = TimerInit()
! 		;While $env("CISCO_SPLIT_INC") <= 0
! 	;		If TimerDiff($wait_start) > $wait_timeout Then
! 	;			ExitLoop
! 	;		EndIf
! 	;		Sleep(10)
! 	;	WEnd
! 
! 		$maxloop = 9
! 		
! 		Local $loopcount = 0
! 		ConsoleWrite("Waiting to configure routes..." & @CRLF)
! 		Do
! 			$routes = getRoutesList($env("INTERNAL_IP4_ADDRESS"))
! 			If $itunid = 0 And $use_wmi = 1 And $runwait = 1 Then
! 				Sleep (1000)
  			EndIf
! 			$loopcount = $loopcount + 1
! 		Until $itunid <> 0 Or $use_wmi = 0 Or $runwait = 0 Or $loopcount > $maxloop
! 		ConsoleWrite("Ready to configure routes after " & $loopcount & " iteration(s) of loop..." & @CRLF)
  
+ 		
  		If $env("CISCO_SPLIT_INC") Then
! 			
  			For $i = 0 To $env("CISCO_SPLIT_INC") -1
  				$network = $env("CISCO_SPLIT_INC_" & $i & "_ADDR")
  				$netmask = $env("CISCO_SPLIT_INC_" & $i & "_MASK")
***************
*** 181,201 ****
  				If $preserve_routes = 1 Then
  					If IsArray($routes) Then
  						If _ArraySearch($routes, $network) < 0 Then
  							ConsoleWrite("route add " & $network & " mask " & $netmask & " " & $env("INTERNAL_IP4_ADDRESS") & @CRLF)
  							FileWriteLine($conscript, @ComSpec & ' /c route add ' & $network & ' mask ' & $netmask & ' ' & $env("INTERNAL_IP4_ADDRESS") & ' > NUL')
! 							;RunWait(@ComSpec & " /c route add " & $network & " mask " & $netmask & " " & $env("INTERNAL_IP4_ADDRESS") & " > NUL", @ScriptDir, @SW_HIDE)
  						Else
  							ConsoleWrite("Skipping network previously in route list: " & $network & @CRLF)
  						EndIf
  					EndIf
  				Else
  					ConsoleWrite("route add " & $network & " mask " & $netmask & " " & $env("INTERNAL_IP4_ADDRESS") & @CRLF)
  					FileWriteLine($conscript, @ComSpec & ' /c route add ' & $network & ' mask ' & $netmask & ' ' & $env("INTERNAL_IP4_ADDRESS") & ' > NUL')
! 					;RunWait(@ComSpec & " /c route add " & $network & " mask " & $netmask & " " & $env("INTERNAL_IP4_ADDRESS") & " > NUL", @ScriptDir, @SW_HIDE)
  				EndIf
  			Next
  		Else
  			ConsoleWrite("Gateway did not provide network configuration." & @CRLF)
  		EndIf
  
  		FileWriteLine($conscript, @ComSpec & ' /c route add ' & $env("VPNGATEWAY") & ' mask 255.255.255.255 ' & $gw & ' > NUL')
--- 235,277 ----
  				If $preserve_routes = 1 Then
  					If IsArray($routes) Then
  						If _ArraySearch($routes, $network) < 0 Then
+ 							If $network <> "0.0.0.0" Then
  							ConsoleWrite("route add " & $network & " mask " & $netmask & " " & $env("INTERNAL_IP4_ADDRESS") & @CRLF)
  							FileWriteLine($conscript, @ComSpec & ' /c route add ' & $network & ' mask ' & $netmask & ' ' & $env("INTERNAL_IP4_ADDRESS") & ' > NUL')
! 							;RunWait(@ComSpec & " /c route add " & $network & " mask " & $netmask & " " & $env("INTERNAL_IP4_ADDRESS") & " > NUL", @Script Dir, @SW_HIDE)
! 							EndIf
  						Else
  							ConsoleWrite("Skipping network previously in route list: " & $network & @CRLF)
  						EndIf
  					EndIf
  				Else
+ 					If $network <> "0.0.0.0" Then
  					ConsoleWrite("route add " & $network & " mask " & $netmask & " " & $env("INTERNAL_IP4_ADDRESS") & @CRLF)
  					FileWriteLine($conscript, @ComSpec & ' /c route add ' & $network & ' mask ' & $netmask & ' ' & $env("INTERNAL_IP4_ADDRESS") & ' > NUL')
! 					;RunWait(@ComSpec & " /c route add " & $network & " mask " & $netmask & " " & $env("INTERNAL_IP4_ADDRESS") & " METRIC 20 IF $itunid > NUL", @ScriptDir, @SW_HIDE)
! 					EndIf
  				EndIf
  			Next
  		Else
  			ConsoleWrite("Gateway did not provide network configuration." & @CRLF)
+ 			;FileWriteLine($conscript, @ComSpec & ' /c route delete 0.0.0.0 mask 0.0.0.0 > NUL')
+ 			If $use_wmi = 1 Then
+ 				$strComputer = "."
+ 				$objWMIService = ObjGet("winmgmts:" _
+ 					& "{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
+ 				$colItems = $objWMIService.ExecQuery("Select Caption, Description, ServiceName  from Win32_NetworkAdapterConfiguration where Index = " & $intindex)
+ 				For $objItem in $colItems
+ 				$result = $objItem.SetIpConnectionMetric(1)
+ 				;MsgBox (1, "Test", "Result : " & $result & @CRLF)
+ 				Next
+ 			Else
+ 			; TODO : Find a method using netsh or RegWrite HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{xxxxx-yyyyy-zzz-to-determine}\InterfaceMetric
+ 			
+ 			EndIf
+ 			Sleep (1000)
+ 			ConsoleWrite("Setting default route to tunnel interface." & @CRLF)
+ 			FileWriteLine($conscript, @ComSpec & ' /c route change 0.0.0.0 mask 0.0.0.0 ' & $gw & ' metric 10 > NUL')
+ 			FileWriteLine($conscript, @ComSpec & ' /c route add 0.0.0.0 mask 0.0.0.0 ' & $env("INTERNAL_IP4_ADDRESS") & ' metric 1 > NUL')
  		EndIf
  
  		FileWriteLine($conscript, @ComSpec & ' /c route add ' & $env("VPNGATEWAY") & ' mask 255.255.255.255 ' & $gw & ' > NUL')
***************
*** 223,246 ****
  EndSwitch
  
  Func getDefaultGateway($sVPNgateway)
! 	$route = Run(@ComSpec & ' /c tracert -d -h 1 ' & $sVPNgateway, @TempDir, @SW_HIDE, $STDOUT_CHILD)
  	Local $default_gateway
  	Local $line
  	Local $no_wmi = 1
! 	While 1
! 		$line &= StdoutRead($route)
! 		If @error Then ExitLoop
! 	WEnd
! 	$split_lines = StringSplit($line, @LF)
! 	If IsArray ($split_lines) Then
! 		For $i = 1 To $split_lines[0]
! 			If StringLeft(StringStripWS($split_lines[$i], 7), 2) = '1 ' Then
! 				$default_gateway = StringStripWS(StringRight($split_lines[$i], StringLen($split_lines[$i]) - StringInStr($split_lines[$i], Chr(32), '', -2)), 7)
! 			EndIf
! 		Next
! 	EndIf
  
! 	If $default_gateway = "" Or $default_gateway = "timed out." Then
  		If $use_wmi = 1 Then
  			Local $wbemFlagReturnImmediately = 0x10
  			Local $wbemFlagForwardOnly = 0x20
--- 299,322 ----
  EndSwitch
  
  Func getDefaultGateway($sVPNgateway)
! ;	$route = Run(@ComSpec & ' /c tracert -d -h 1 ' & $sVPNgateway, @TempDir, @SW_HIDE, $STDOUT_CHILD)
  	Local $default_gateway
  	Local $line
  	Local $no_wmi = 1
! ;	While 1
! ;		$line &= StdoutRead($route)
! ;		If @error Then ExitLoop
! ;	WEnd
! ;	$split_lines = StringSplit($line, @LF)
! ;	If IsArray ($split_lines) Then
! ;		For $i = 1 To $split_lines[0]
! ;			If StringLeft(StringStripWS($split_lines[$i], 7), 2) = '1 ' Then
! ;				$default_gateway = StringStripWS(StringRight($split_lines[$i], StringLen($split_lines[$i]) - StringInStr($split_lines[$i], Chr(32), '', -2)), 7)
! ;			EndIf
! ;		Next
! ;	EndIf
  
! ;	If $default_gateway = "" Or $default_gateway = "timed out." Then
  		If $use_wmi = 1 Then
  			Local $wbemFlagReturnImmediately = 0x10
  			Local $wbemFlagForwardOnly = 0x20
***************
*** 263,270 ****
  			Else
  				$no_wmi = 1
  			EndIf
! 		EndIf
! 		If $use_wmi = 0 Or $no_wmi = 1 Then
  			$route = Run(@ComSpec & ' /c route print 0.0.0.0', @TempDir, @SW_HIDE, $STDOUT_CHILD)
  			Local $default_gateway = ""
  			Local $line
--- 339,345 ----
  			Else
  				$no_wmi = 1
  			EndIf
! 		ElseIf $use_wmi = 0 Or $no_wmi = 1 Then
  			$route = Run(@ComSpec & ' /c route print 0.0.0.0', @TempDir, @SW_HIDE, $STDOUT_CHILD)
  			Local $default_gateway = ""
  			Local $line
***************
*** 287,293 ****
  				$default_gateway = ""
  			EndIf
  		EndIf
! 	EndIf
  	Return $default_gateway
  EndFunc   ;==>getDefaultGateway
  
--- 362,368 ----
  				$default_gateway = ""
  			EndIf
  		EndIf
! 	;EndIf
  	Return $default_gateway
  EndFunc   ;==>getDefaultGateway
  
***************
*** 331,337 ****
  	Return $default_gateway
  EndFunc   ;==>getDefaultGatewayOld
  
! Func getRoutesList()
  	Local $no_wmi = 1
  	Dim $routes[1]
  	If $use_wmi = 1 Then
--- 406,412 ----
  	Return $default_gateway
  EndFunc   ;==>getDefaultGatewayOld
  
! Func getRoutesList($envipaddr)
  	Local $no_wmi = 1
  	Dim $routes[1]
  	If $use_wmi = 1 Then
***************
*** 348,353 ****
--- 423,433 ----
  			If IsObj($colItems) Then
  				For $objItem In $colItems
  					_ArrayAdd($routes, $objItem.Destination)
+ 					;MsgBox (0, "vpnc", "Interface Index: " & $objItem.InterfaceIndex & " dest : " & $objItem.Destination & " nh : " & $objItem.NextHop &  @CRLF)
+ 					If $objItem.Destination = $envipaddr Then
+ 						$itunid = $objItem.InterfaceIndex
+ 					;MsgBox (0, "vpnc", "Interface Index: " & $itunid & @CRLF)
+ 					EndIf
  				Next
  			EndIf
  		Else

