From f7d4f49809ee76b990f3cea3dc4a02e1076d3391 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sun, 28 Aug 2022 15:51:17 -0400 Subject: [PATCH] fix windows `add-firewall-rule` script --- src_assets/windows/misc/firewall/add-firewall-rule.bat | 9 ++++++++- src_assets/windows/misc/service/install-service.bat | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src_assets/windows/misc/firewall/add-firewall-rule.bat b/src_assets/windows/misc/firewall/add-firewall-rule.bat index 8c3e7b9e..d1a4b2fd 100644 --- a/src_assets/windows/misc/firewall/add-firewall-rule.bat +++ b/src_assets/windows/misc/firewall/add-firewall-rule.bat @@ -1,7 +1,14 @@ @echo off +rem Get sunshine root directory +for %%I in ("%~dp0\..") do set "ROOT_DIR=%%~fI" + set RULE_NAME=Sunshine -set PROGRAM_BIN="%~dp0sunshine.exe" +set PROGRAM_BIN="%ROOT_DIR%\sunshine.exe" + +echo %PROGRAM_BIN% + +pause rem Add the rule netsh advfirewall firewall add rule name=%RULE_NAME% dir=in action=allow protocol=tcp program=%PROGRAM_BIN% enable=yes diff --git a/src_assets/windows/misc/service/install-service.bat b/src_assets/windows/misc/service/install-service.bat index 887c5aa3..af27fec1 100644 --- a/src_assets/windows/misc/service/install-service.bat +++ b/src_assets/windows/misc/service/install-service.bat @@ -1,10 +1,10 @@ @echo off rem Get sunshine root directory -for %%I in ("%~dp0\..") do set "root_dir=%%~fI" +for %%I in ("%~dp0\..") do set "ROOT_DIR=%%~fI" set SERVICE_NAME=sunshinesvc -set SERVICE_BIN="%root_dir%\tools\sunshinesvc.exe" +set SERVICE_BIN="%ROOT_DIR%\tools\sunshinesvc.exe" set SERVICE_START_TYPE=auto rem Check if sunshinesvc already exists