From 56915ccf5b5145e56f224da9e9e3dc9b0c7e09a6 Mon Sep 17 00:00:00 2001 From: Jim Yang Date: Sun, 15 Apr 2018 17:51:57 +0800 Subject: [PATCH] Allow UDP 3389 at firewall configuration --- res/legacy.install.bat | 3 ++- src-installer/RDPWInst.dpr | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/res/legacy.install.bat b/res/legacy.install.bat index a7d8de2..303cc32 100644 --- a/res/legacy.install.bat +++ b/res/legacy.install.bat @@ -50,6 +50,7 @@ if not !errorlevel!==0 ( echo [*] Setting firewall configuration... reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f netsh advfirewall firewall add rule name="Remote Desktop" dir=in protocol=tcp localport=3389 profile=any action=allow +netsh advfirewall firewall add rule name="Remote Desktop" dir=in protocol=udp localport=3389 profile=any action=allow echo [*] Looking for TermService PID... tasklist /SVC /FI "SERVICES eq TermService" | find "PID" /V echo. @@ -88,4 +89,4 @@ echo net start Service2 echo etc. goto END -:END \ No newline at end of file +:END diff --git a/src-installer/RDPWInst.dpr b/src-installer/RDPWInst.dpr index 7894f3b..b6c2462 100644 --- a/src-installer/RDPWInst.dpr +++ b/src-installer/RDPWInst.dpr @@ -978,8 +978,10 @@ end; procedure TSConfigFirewall(Enable: Boolean); begin if Enable then - ExecWait('netsh advfirewall firewall add rule name="Remote Desktop" dir=in protocol=tcp localport=3389 profile=any action=allow') - else + begin + ExecWait('netsh advfirewall firewall add rule name="Remote Desktop" dir=in protocol=tcp localport=3389 profile=any action=allow'); + ExecWait('netsh advfirewall firewall add rule name="Remote Desktop" dir=in protocol=udp localport=3389 profile=any action=allow'); + end else ExecWait('netsh advfirewall firewall delete rule name="Remote Desktop"'); end;