Repository navigation
Expand file tree
/
Copy pathinstall.bat
More file actions
69 lines (58 loc) · 2.34 KB
/
Copy pathinstall.bat
File metadata and controls
69 lines (58 loc) · 2.34 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@echo off
:: Synapse Windows Installer
:: Launches the PowerShell installer (install.ps1) with execution policy bypass.
:: Right-click and "Run as administrator", or run from an elevated command prompt.
::
:: Usage:
:: install.bat - Interactive install (prompts for API key)
:: install.bat YOUR-API-KEY - Install with API key
:: install.bat /uninstall - Uninstall Synapse
::
:: For advanced options (--WithEBPF, --NoService, --Version, etc.) run install.ps1 directly.
setlocal
:: ── Locate this script's directory ──────────────────────────────────────────
set "SCRIPT_DIR=%~dp0"
set "PS_SCRIPT=%SCRIPT_DIR%install.ps1"
if not exist "%PS_SCRIPT%" (
echo ERROR: install.ps1 not found in %SCRIPT_DIR%
echo Download it from https://github.com/gen0sec/synapse
pause
exit /b 1
)
:: ── Build PowerShell argument list ──────────────────────────────────────────
set "PS_ARGS=-ExecutionPolicy Bypass -File \"%PS_SCRIPT%\""
if "%~1"=="/uninstall" (
set "PS_ARGS=%PS_ARGS% -Uninstall"
goto :run
)
if "%~1"=="/?" (
echo Usage:
echo install.bat - Install ^(prompts for API key if needed^)
echo install.bat YOUR-API-KEY - Install with API key
echo install.bat /uninstall - Uninstall Synapse
echo.
echo For advanced options, run install.ps1 directly with PowerShell.
exit /b 0
)
if not "%~1"=="" (
set "PS_ARGS=%PS_ARGS% -ApiKey \"%~1\""
)
:run
:: ── Check for admin, self-elevate if needed ──────────────────────────────────
net session >nul 2>&1
if %errorlevel% neq 0 (
echo Requesting administrator privileges...
powershell -Command "Start-Process cmd -ArgumentList '/c cd /d %SCRIPT_DIR% && %~nx0 %*' -Verb RunAs"
exit /b 0
)
:: ── Launch PowerShell installer ──────────────────────────────────────────────
powershell.exe %PS_ARGS%
if %errorlevel% neq 0 (
echo.
echo Installation failed. Exit code: %errorlevel%
echo See output above for details.
pause
exit /b %errorlevel%
)
pause
endlocal