Move variables to env.cmd
This commit is contained in:
@@ -4,6 +4,8 @@ echo This script downloads the Beszel repository and builds the Beszel agent for
|
|||||||
echo If not yet installed, Git and Go will be installed via Winget.
|
echo If not yet installed, Git and Go will be installed via Winget.
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
|
call env.cmd
|
||||||
|
|
||||||
where winget.exe >nul 2>&1
|
where winget.exe >nul 2>&1
|
||||||
if %errorlevel% NEQ 0 (
|
if %errorlevel% NEQ 0 (
|
||||||
echo Winget not found, install Winget or use a compatible OS: Win 10 Client OS or later
|
echo Winget not found, install Winget or use a compatible OS: Win 10 Client OS or later
|
||||||
@@ -38,9 +40,6 @@ if %errorlevel% NEQ 0 (
|
|||||||
cd .\beszel\beszel\cmd\agent
|
cd .\beszel\beszel\cmd\agent
|
||||||
|
|
||||||
echo Building agent
|
echo Building agent
|
||||||
set GOOS=windows
|
|
||||||
set GOARCH=amd64
|
|
||||||
set CGO_ENABLED=0
|
|
||||||
go build -ldflags "-w -s" . >nul 2>&1
|
go build -ldflags "-w -s" . >nul 2>&1
|
||||||
if %errorlevel% NEQ 0 (
|
if %errorlevel% NEQ 0 (
|
||||||
echo Something went wrong
|
echo Something went wrong
|
||||||
|
@@ -19,10 +19,7 @@ if !%2==! goto help
|
|||||||
|
|
||||||
set BESZELKEYPREFIX=%1
|
set BESZELKEYPREFIX=%1
|
||||||
set BESZELKEY=%2
|
set BESZELKEY=%2
|
||||||
set SERVICENAME=BeszelAgent
|
call env.cmd
|
||||||
set DESTINATIONDIR=%ProgramFiles%\%SERVICENAME%
|
|
||||||
set AGENTEXE=%DESTINATIONDIR%\agent.exe
|
|
||||||
set NSSMEXE=nssm.exe
|
|
||||||
|
|
||||||
where nssm.exe >nul 2>&1
|
where nssm.exe >nul 2>&1
|
||||||
if %errorlevel% NEQ 0 goto installnssm
|
if %errorlevel% NEQ 0 goto installnssm
|
||||||
|
Reference in New Issue
Block a user