-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGensui-Install.bat
More file actions
128 lines (109 loc) · 4.24 KB
/
Copy pathGensui-Install.bat
File metadata and controls
128 lines (109 loc) · 4.24 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
@echo off
chcp 65001 >nul 2>&1
setlocal EnableDelayedExpansion
:: ===============================================================
:: GENSUI - One-Click Downloader & Installer (Windows)
::
:: This is a STANDALONE file. Download it, double-click it,
:: and Shogun will be installed automatically. No git required.
:: Prerequisites (Python, Node.js) will be installed for you.
:: ===============================================================
title Gensui - Installing...
echo.
echo +----------------------------------------------------------+
echo : :
echo : GENSUI - Agent Fleet Management One-Click Installer :
echo : :
echo +----------------------------------------------------------+
echo.
:: -- Configuration ----------------------------------------------
set "REPO=AlphaHorizon-AI/Shogun"
set "BRANCH=main"
set "INSTALL_DIR=%USERPROFILE%\Gensui"
set "ZIP_URL=https://github.com/%REPO%/archive/refs/heads/%BRANCH%.zip"
set "ZIP_FILE=%TEMP%\shogun-download.zip"
:: -- Check and install prerequisites ----------------------------
echo ======================================================
echo Checking prerequisites...
echo ======================================================
echo.
:: -- Python -----------------------------------------------------
python --version >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo [!] Python is not installed.
echo.
echo Gensui requires Python 3.10+ to run.
echo Please download and install it from: https://www.python.org/downloads/
echo Be sure to check "Add python.exe to PATH" during installation.
echo.
pause
exit /b 1
) else (
for /f "tokens=2 delims= " %%v in ('python --version 2^>^&1') do (
echo [OK] Python %%v
)
)
:: -- Node.js ----------------------------------------------------
node --version >nul 2>&1
if %ERRORLEVEL% neq 0 (
echo [!] Node.js is not installed.
echo.
echo Gensui requires Node.js v18+ to build the interface.
echo Please download and install it from: https://nodejs.org/
echo.
pause
exit /b 1
) else (
for /f "tokens=1 delims= " %%v in ('node --version 2^>^&1') do (
echo [OK] Node.js %%v
)
)
echo.
:: -- Download ---------------------------------------------------
echo ======================================================
echo [+] Downloading Gensui from GitHub...
echo ======================================================
echo.
echo %ZIP_URL%
echo.
powershell -NoProfile -ExecutionPolicy Bypass -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (New-Object Net.WebClient).DownloadFile('%ZIP_URL%', '%ZIP_FILE%')"
if not exist "%ZIP_FILE%" (
echo [!] Download failed. Please check your internet connection.
pause
exit /b 1
)
echo [OK] Download complete.
echo.
:: -- Extract ----------------------------------------------------
echo [+] Extracting to %INSTALL_DIR%...
if exist "%INSTALL_DIR%\.env" (
copy "%INSTALL_DIR%\.env" "%TEMP%\gensui_setup_backup.json" >nul 2>&1
)
powershell -NoProfile -ExecutionPolicy Bypass -Command "Expand-Archive -Path '%ZIP_FILE%' -DestinationPath '%TEMP%\shogun-extract' -Force"
if exist "%TEMP%\shogun-extract\Shogun-%BRANCH%" (
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"
robocopy "%TEMP%\shogun-extract\Shogun-%BRANCH%" "%INSTALL_DIR%" /E /XD data venv .venv node_modules /NFL /NDL /NJH /NJS >nul 2>&1
)
if exist "%TEMP%\gensui_setup_backup.json" (
if not exist "%INSTALL_DIR%\configs" mkdir "%INSTALL_DIR%\configs"
copy "%TEMP%\gensui_setup_backup.json" "%INSTALL_DIR%\.env" >nul 2>&1
del "%TEMP%\gensui_setup_backup.json" >nul 2>&1
)
del "%ZIP_FILE%" >nul 2>&1
rmdir /s /q "%TEMP%\shogun-extract" >nul 2>&1
echo [OK] Extracted to %INSTALL_DIR%
echo.
:: -- Run installer ----------------------------------------------
echo ======================================================
echo [+] Running Gensui installer...
echo ======================================================
echo.
cd /d "%INSTALL_DIR%\gensui"
if exist "install.bat" (
call install.bat
exit /b 0
) else (
echo [!] Error: install.bat not found in %INSTALL_DIR%
pause
exit /b 1
)