Skip to content

Force Proxy to any Windows/MacOS/Linux Application TCP and UDP traffic

#81 - added stopper during installation

AnoF-Cyber043c5410143e
diff --git a/Windows/installer/ProxyBridge.nsi b/Windows/installer/ProxyBridge.nsi
index c9e1c79..e257d0b 100644
--- a/Windows/installer/ProxyBridge.nsi
+++ b/Windows/installer/ProxyBridge.nsi
@@ -44,6 +44,19 @@ RequestExecutionLevel admin
!insertmacro MUI_LANGUAGE "English"
Section "MainSection" SEC01
+ ; Kill any running ProxyBridge instance before overwriting files.
+ ; This prevents "file in use" errors on update/reinstall.
+ nsExec::ExecToLog 'taskkill /F /IM ProxyBridge.exe'
+ nsExec::ExecToLog 'taskkill /F /IM ProxyBridge_CLI.exe'
+
+ ; Stop and unload the WinDivert driver so WinDivert64.sys can be replaced.
+ nsExec::ExecToLog 'sc stop WinDivert'
+ nsExec::ExecToLog 'sc delete WinDivert'
+ DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Services\WinDivert"
+
+ ; Brief pause to let the OS release all file handles.
+ Sleep 1000
+
SetOutPath "$INSTDIR"
SetOverwrite on