Add build script

This commit is contained in:
2025-01-19 14:37:37 +01:00
parent 39069fe26d
commit 3b730c162b
2 changed files with 56 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ set AGENTEXE=%DESTINATIONDIR%\agent.exe
set NSSMEXE=nssm.exe
where nssm.exe >nul 2>&1
if %errorlevel%==1 goto installnssm
if %errorlevel% NEQ 0 goto installnssm
goto proceed
:installnssm
@@ -42,21 +42,21 @@ netsh advfirewall firewall add rule name="%SERVICENAME%" dir=in action=allow pro
echo Installing service %SERVICENAME%
%NSSMEXE% install %SERVICENAME% "%AGENTEXE%" >nul 2>&1
if %errorlevel%==1 (
if %errorlevel% NEQ 0 (
echo Failed to install the service.
goto end
)
echo Setting environment for %SERVICENAME%
%NSSMEXE% set %SERVICENAME% AppEnvironmentExtra "KEY=%BESZELKEYPREFIX% %BESZELKEY%" >nul 2>&1
if %errorlevel%==1 (
if %errorlevel% NEQ 0 (
echo Failed to set the service environment.
goto end
)
echo Starting %SERVICENAME%
%NSSMEXE% start %SERVICENAME% >nul 2>&1
if %errorlevel%==1 (
if %errorlevel% NEQ 0 (
echo Failed to start service.
goto end
)