-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.bat
More file actions
executable file
·28 lines (24 loc) · 1008 Bytes
/
Copy pathinstall.bat
File metadata and controls
executable file
·28 lines (24 loc) · 1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@echo off
REM std-agent 安装脚本入口 (Windows cmd)
REM 转发到 install.ps1,因为 GitHub API JSON 解析与 SHA256 校验在纯 cmd 中不可靠
setlocal
where powershell >nul 2>nul
if errorlevel 1 (
echo [install] PowerShell 不可用,请改用 install.ps1 手动安装。
exit /b 1
)
set "SCRIPT_DIR=%~dp0"
set "PS1=%SCRIPT_DIR%install.ps1"
if exist "%PS1%" (
echo [install] 使用本地 install.ps1
powershell -NoProfile -ExecutionPolicy Bypass -File "%PS1%" %*
) else (
if "%STD_AGENT_OWNER%"=="" (set "OWNER=StringKe") else (set "OWNER=%STD_AGENT_OWNER%")
if "%STD_AGENT_REPO%"=="" (set "REPO=std-agent") else (set "REPO=%STD_AGENT_REPO%")
set "PS_URL=https://raw.githubusercontent.com/%OWNER%/%REPO%/main/install.ps1"
echo [install] 远程拉取 %PS_URL%
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex (irm '%PS_URL%')"
)
set "RC=%ERRORLEVEL%"
endlocal & exit /b %RC%