启动脚本

This commit is contained in:
yuejiajun 2025-08-20 19:42:11 +08:00
parent c8e52b9fb4
commit 7248d9c4cf
8 changed files with 493 additions and 48 deletions

View File

@ -1,18 +1,128 @@
@echo off
chcp 65001
title Eval Quick Start
setlocal enabledelayedexpansion
chcp 65001 >nul
cd %EVAL_MAIN%
if exist "%EVAL_MANAGE%" (
start "Eval Server" cmd /k "java -jar %EVAL_VM_PARAMS% -jar %EVAL_MANAGE_BIN%"
set SERVER_UPPER=EVAL
set SERVER_LOWER=eval
set SERVER_HUMP=Eval
set /a SERVER_PORT=28480
set /a WEBSITE_PORT=%SERVER_PORT%-10000
set modifyTitle=1
for %%a in (%*) do (
if /i "%%a"=="/notitle" set modifyTitle=0
)
if exist "%EVAL_MANAGE%" (
start "Eval Website" cmd /k "cd web && eval-web.exe -c conf/web.conf"
if %modifyTitle% equ 1 (
title %SERVER_HUMP% Quick Start
)
echo Eval:
echo - EvalServer (Port: 28480)
echo - EvalWebsite (Port: 18480)
:: =============================================
:: Validation
:: =============================================
if not defined !SERVER_UPPER!_MAIN (
echo [ERROR] !SERVER_UPPER!_MAIN environment variable is not defined
pause && exit /b 1
)
pause
if not defined !SERVER_UPPER!_MANAGE_BIN (
echo [ERROR] !SERVER_UPPER!_MANAGE_BIN environment variable is not defined
pause && exit /b 1
)
if not defined !SERVER_UPPER!_VM_PARAMS (
echo Warning: !SERVER_UPPER!_VM_PARAMS environment variable is not defined
set %SERVER_UPPER%_VM_PARAMS=-Xms512m -Xmx2048m
)
cd /d "!%SERVER_UPPER%_MAIN!" 2>nul
if errorlevel 1 (
echo [ERROR] Directory not found: !%SERVER_UPPER%_MAIN!
echo Please verify %SERVER_UPPER%_MAIN environment variable
pause && exit /b 1
)
if not exist "!%SERVER_UPPER%_MANAGE_BIN!" (
echo [ERROR] Main JAR file not found: !%SERVER_UPPER%_MANAGE_BIN!
echo Please verify %SERVER_UPPER%_MANAGE_BIN environment variable
pause && exit /b 1
)
cd web 2>nul
if errorlevel 1 (
echo [ERROR] web directory does not exist in !%SERVER_UPPER%_MAIN!
pause && exit /b 1
)
if not exist "%SERVER_LOWER%-web.exe" (
echo [ERROR] %SERVER_LOWER%-web.exe does not exist in !%SERVER_UPPER%_MAIN!\web
pause && exit /b 1
)
if not exist "conf\web.conf" (
echo [ERROR] conf\web.conf does not exist in !%SERVER_UPPER%_MAIN!\web
pause && exit /b 1
)
:: =============================================
:: Service Launch
:: =============================================
cd ..
setlocal
echo Starting %SERVER_HUMP% Server...
jps -v | grep "\-Dserver.port=%SERVER_PORT%" | awk "{print $1}" >server.tmp
set /p pid=<server.tmp
del /f /q server.tmp 2>nul
if defined pid (
taskkill -f -pid !pid!
)
start "%SERVER_HUMP% Server" /B cmd /c "chcp 65001 && java !%SERVER_UPPER%_VM_PARAMS! -jar !%SERVER_UPPER%_MANAGE_BIN!"
echo Starting %SERVER_HUMP% Website...
cd web
taskkill -f -im %SERVER_LOWER%-web.exe >nul
start "%SERVER_HUMP% Website" /B cmd /c "%SERVER_LOWER%-web.exe -c conf\web.conf"
set MAX_WAIT=300
set CHECK_INTERVAL=5
set counter=0
echo Waiting for services to start...
echo.
:CHECK_LOOP
netstat -an | find ":%SERVER_PORT%" > nul
set server_up=%errorlevel%
netstat -an | find ":%WEBSITE_PORT%" > nul
set website_up=%errorlevel%
if !server_up! equ 0 if !website_up! equ 0 (
call :DISPLAY_SUCCESS
exit /b 0
)
set /a counter+=CHECK_INTERVAL
if !counter! geq %MAX_WAIT% (
echo Error: Services did not start within !counter! seconds
exit /b 1
)
timeout /t %CHECK_INTERVAL% /nobreak > nul
goto CHECK_LOOP
:DISPLAY_SUCCESS
:: =============================================
:: Status Display
:: =============================================
echo.
echo ========================================
echo %SERVER_HUMP% Services Successfully Started
echo ========================================
echo - %SERVER_HUMP% Server (Port: %SERVER_PORT%)
echo - %SERVER_HUMP% Website (Port: %WEBSITE_PORT%)
echo ========================================
echo.
endlocal
exit /b 0

View File

@ -1,7 +1,7 @@
;iss
#define MyAppName "效能评估"
#define MyAppVersion "1.0.2"
#define MyAppVersion "1.0.3"
#define MyAppPublisher "X"
#define MyAppURL "~"
#define MyAppExeName "eval"

View File

@ -1,18 +1,128 @@
@echo off
chcp 65001
title Model Quick Start
setlocal enabledelayedexpansion
chcp 65001 >nul
cd %MODEL_MAIN%
if exist "%MODEL_MANAGE_BIN%" (
start "Model Server" cmd /k "java -jar %MODEL_VM_PARAMS% -jar %MODEL_MANAGE_BIN%"
set SERVER_UPPER=MODEL
set SERVER_LOWER=model
set SERVER_HUMP=Model
set /a SERVER_PORT=28680
set /a WEBSITE_PORT=%SERVER_PORT%-10000
set modifyTitle=1
for %%a in (%*) do (
if /i "%%a"=="/notitle" set modifyTitle=0
)
if exist "%MODEL_MANAGE_BIN%" (
start "Model Website" cmd /k "cd web && model-web.exe -c conf/web.conf"
if %modifyTitle% equ 1 (
title %SERVER_HUMP% Quick Start
)
echo Model:
echo - ModelServer (Port: 28680)
echo - ModelWebsite (Port: 18680)
:: =============================================
:: Validation
:: =============================================
if not defined !SERVER_UPPER!_MAIN (
echo [ERROR] !SERVER_UPPER!_MAIN environment variable is not defined
pause && exit /b 1
)
pause
if not defined !SERVER_UPPER!_MANAGE_BIN (
echo [ERROR] !SERVER_UPPER!_MANAGE_BIN environment variable is not defined
pause && exit /b 1
)
if not defined !SERVER_UPPER!_VM_PARAMS (
echo Warning: !SERVER_UPPER!_VM_PARAMS environment variable is not defined
set %SERVER_UPPER%_VM_PARAMS=-Xms512m -Xmx2048m
)
cd /d "!%SERVER_UPPER%_MAIN!" 2>nul
if errorlevel 1 (
echo [ERROR] Directory not found: !%SERVER_UPPER%_MAIN!
echo Please verify %SERVER_UPPER%_MAIN environment variable
pause && exit /b 1
)
if not exist "!%SERVER_UPPER%_MANAGE_BIN!" (
echo [ERROR] Main JAR file not found: !%SERVER_UPPER%_MANAGE_BIN!
echo Please verify %SERVER_UPPER%_MANAGE_BIN environment variable
pause && exit /b 1
)
cd web 2>nul
if errorlevel 1 (
echo [ERROR] web directory does not exist in !%SERVER_UPPER%_MAIN!
pause && exit /b 1
)
if not exist "%SERVER_LOWER%-web.exe" (
echo [ERROR] %SERVER_LOWER%-web.exe does not exist in !%SERVER_UPPER%_MAIN!\web
pause && exit /b 1
)
if not exist "conf\web.conf" (
echo [ERROR] conf\web.conf does not exist in !%SERVER_UPPER%_MAIN!\web
pause && exit /b 1
)
:: =============================================
:: Service Launch
:: =============================================
cd ..
setlocal
echo Starting %SERVER_HUMP% Server...
jps -v | grep "\-Dserver.port=%SERVER_PORT%" | awk "{print $1}" >server.tmp
set /p pid=<server.tmp
del /f /q server.tmp 2>nul
if defined pid (
taskkill -f -pid !pid!
)
start "%SERVER_HUMP% Server" /B cmd /c "chcp 65001 && java !%SERVER_UPPER%_VM_PARAMS! -jar !%SERVER_UPPER%_MANAGE_BIN!"
echo Starting %SERVER_HUMP% Website...
cd web
taskkill -f -im %SERVER_LOWER%-web.exe >nul
start "%SERVER_HUMP% Website" /B cmd /c "%SERVER_LOWER%-web.exe -c conf\web.conf"
set MAX_WAIT=300
set CHECK_INTERVAL=5
set counter=0
echo Waiting for services to start...
echo.
:CHECK_LOOP
netstat -an | find ":%SERVER_PORT%" > nul
set server_up=%errorlevel%
netstat -an | find ":%WEBSITE_PORT%" > nul
set website_up=%errorlevel%
if !server_up! equ 0 if !website_up! equ 0 (
call :DISPLAY_SUCCESS
exit /b 0
)
set /a counter+=CHECK_INTERVAL
if !counter! geq %MAX_WAIT% (
echo Error: Services did not start within !counter! seconds
exit /b 1
)
timeout /t %CHECK_INTERVAL% /nobreak > nul
goto CHECK_LOOP
:DISPLAY_SUCCESS
:: =============================================
:: Status Display
:: =============================================
echo.
echo ========================================
echo %SERVER_HUMP% Services Successfully Started
echo ========================================
echo - %SERVER_HUMP% Server (Port: %SERVER_PORT%)
echo - %SERVER_HUMP% Website (Port: %WEBSITE_PORT%)
echo ========================================
echo.
endlocal
exit /b 0

View File

@ -1,7 +1,7 @@
;iss
#define MyAppName "模型管理"
#define MyAppVersion "1.0.1"
#define MyAppVersion "1.0.2"
#define MyAppPublisher "X"
#define MyAppURL "~"
#define MyAppExeName "model"

View File

@ -1,18 +1,134 @@
@echo off
chcp 65001
title Scenario Quick Start
setlocal enabledelayedexpansion
chcp 65001 >nul
cd %SCENARIO_MAIN%
if exist "%SCENARIO_MANAGE_BIN%" (
start "Scenario Server" cmd /k "java -jar %SCENARIO_VM_PARAMS% -jar %SCENARIO_MANAGE_BIN%"
set SERVER_UPPER=SCENARIO
set SERVER_LOWER=scenario
set SERVER_HUMP=Scenario
set /a SERVER_PORT=28880
set /a WEBSITE_PORT=%SERVER_PORT%-10000
set modifyTitle=1
for %%a in (%*) do (
if /i "%%a"=="/notitle" set modifyTitle=0
)
if exist "%SCENARIO_MANAGE_BIN%" (
start "Scenario Website" cmd /k "cd web && scenario-web.exe -c conf/web.conf"
if %modifyTitle% equ 1 (
title %SERVER_HUMP% Quick Start
)
echo Scenario:
echo - ScenarioServer (Port: 28880)
echo - ScenarioWebsite (Port: 18880)
:: =============================================
:: Validation
:: =============================================
if not defined !SERVER_UPPER!_MAIN (
echo [ERROR] !SERVER_UPPER!_MAIN environment variable is not defined
pause && exit /b 1
)
pause
if not defined !SERVER_UPPER!_MANAGE_BIN (
echo [ERROR] !SERVER_UPPER!_MANAGE_BIN environment variable is not defined
pause && exit /b 1
)
if not defined !SERVER_UPPER!_VM_PARAMS (
echo Warning: !SERVER_UPPER!_VM_PARAMS environment variable is not defined
set %SERVER_UPPER%_VM_PARAMS=-Xms512m -Xmx2048m
)
cd /d "!%SERVER_UPPER%_MAIN!" 2>nul
if errorlevel 1 (
echo [ERROR] Directory not found: !%SERVER_UPPER%_MAIN!
echo Please verify %SERVER_UPPER%_MAIN environment variable
pause && exit /b 1
)
if not exist "!%SERVER_UPPER%_MANAGE_BIN!" (
echo [ERROR] Main JAR file not found: !%SERVER_UPPER%_MANAGE_BIN!
echo Please verify %SERVER_UPPER%_MANAGE_BIN environment variable
pause && exit /b 1
)
cd web 2>nul
if errorlevel 1 (
echo [ERROR] web directory does not exist in !%SERVER_UPPER%_MAIN!
pause && exit /b 1
)
if not exist "%SERVER_LOWER%-web.exe" (
echo [ERROR] %SERVER_LOWER%-web.exe does not exist in !%SERVER_UPPER%_MAIN!\web
pause && exit /b 1
)
if not exist "conf\web.conf" (
echo [ERROR] conf\web.conf does not exist in !%SERVER_UPPER%_MAIN!\web
pause && exit /b 1
)
:: =============================================
:: Service Launch
:: =============================================
cd ..
setlocal
echo Starting %SERVER_HUMP% Server...
jps -v | grep "\-Dserver.port=%SERVER_PORT%" | awk "{print $1}" >server.tmp
set /p pid=<server.tmp
del /f /q server.tmp 2>nul
if defined pid (
taskkill -f -pid !pid!
)
start "%SERVER_HUMP% Server" /B cmd /c "chcp 65001 && java !%SERVER_UPPER%_VM_PARAMS! -jar !%SERVER_UPPER%_MANAGE_BIN!"
echo Starting %SERVER_HUMP% Website...
cd web
cd dist && mkdir temp && cd temp && cp ../wsUrl.js .
sed -i "s/6680/18680/" wsUrl.js >nul
sed -i "s/6681/18280/" wsUrl.js >nul
sed -i "s/6682/18880/" wsUrl.js >nul
sed -i "s/6683/18480/" wsUrl.js >nul
cp wsUrl.js .. && cd .. && rm -rf temp && cd ..
taskkill -f -im %SERVER_LOWER%-web.exe >nul
start "%SERVER_HUMP% Website" /B cmd /c "%SERVER_LOWER%-web.exe -c conf\web.conf"
set MAX_WAIT=300
set CHECK_INTERVAL=5
set counter=0
echo Waiting for services to start...
echo.
:CHECK_LOOP
netstat -an | find ":%SERVER_PORT%" > nul
set server_up=%errorlevel%
netstat -an | find ":%WEBSITE_PORT%" > nul
set website_up=%errorlevel%
if !server_up! equ 0 if !website_up! equ 0 (
call :DISPLAY_SUCCESS
exit /b 0
)
set /a counter+=CHECK_INTERVAL
if !counter! geq %MAX_WAIT% (
echo Error: Services did not start within !counter! seconds
exit /b 1
)
timeout /t %CHECK_INTERVAL% /nobreak > nul
goto CHECK_LOOP
:DISPLAY_SUCCESS
:: =============================================
:: Status Display
:: =============================================
echo.
echo ========================================
echo %SERVER_HUMP% Services Successfully Started
echo ========================================
echo - %SERVER_HUMP% Server (Port: %SERVER_PORT%)
echo - %SERVER_HUMP% Website (Port: %WEBSITE_PORT%)
echo ========================================
echo.
endlocal
exit /b 0

View File

@ -1,7 +1,7 @@
;iss
#define MyAppName "想定筹划"
#define MyAppVersion "1.0.1"
#define MyAppVersion "1.0.3"
#define MyAppPublisher "X"
#define MyAppURL "~"
#define MyAppExeName "scenario"

View File

@ -1,19 +1,128 @@
@echo off
setlocal enabledelayedexpansion
chcp 65001 >nul
title Simulation Quick Start
cd %SIMULATION_MAIN%
if exist "%SIMULATION_MANAGE_BIN%" (
start "Simulation Server" cmd /k "chcp 65001 && title Simulation Server && java -Dspring.profiles.active=test,mysql,redis,rocketmq,springdoc %SIMULATION_VM_PARAMS% -jar %SIMULATION_MANAGE_BIN%"
set SERVER_UPPER=SIMULATION
set SERVER_LOWER=simulation
set SERVER_HUMP=Simulation
set /a SERVER_PORT=28280
set /a WEBSITE_PORT=%SERVER_PORT%-10000
set modifyTitle=1
for %%a in (%*) do (
if /i "%%a"=="/notitle" set modifyTitle=0
)
if exist "%SIMULATION_MANAGE_BIN%" (
cd web
start "Simulation Website" cmd /k "title Simulation Website && simulation-web.exe -c conf/web.conf"
if %modifyTitle% equ 1 (
title %SERVER_HUMP% Quick Start
)
echo Simulation:
echo - SimulationServer (Port: 28280)
echo - SimulationWebsite (Port: 18280)
:: =============================================
:: Validation
:: =============================================
if not defined !SERVER_UPPER!_MAIN (
echo [ERROR] !SERVER_UPPER!_MAIN environment variable is not defined
pause && exit /b 1
)
pause
if not defined !SERVER_UPPER!_MANAGE_BIN (
echo [ERROR] !SERVER_UPPER!_MANAGE_BIN environment variable is not defined
pause && exit /b 1
)
if not defined !SERVER_UPPER!_VM_PARAMS (
echo Warning: !SERVER_UPPER!_VM_PARAMS environment variable is not defined
set %SERVER_UPPER%_VM_PARAMS=-Xms512m -Xmx2048m
)
cd /d "!%SERVER_UPPER%_MAIN!" 2>nul
if errorlevel 1 (
echo [ERROR] Directory not found: !%SERVER_UPPER%_MAIN!
echo Please verify %SERVER_UPPER%_MAIN environment variable
pause && exit /b 1
)
if not exist "!%SERVER_UPPER%_MANAGE_BIN!" (
echo [ERROR] Main JAR file not found: !%SERVER_UPPER%_MANAGE_BIN!
echo Please verify %SERVER_UPPER%_MANAGE_BIN environment variable
pause && exit /b 1
)
cd web 2>nul
if errorlevel 1 (
echo [ERROR] web directory does not exist in !%SERVER_UPPER%_MAIN!
pause && exit /b 1
)
if not exist "%SERVER_LOWER%-web.exe" (
echo [ERROR] %SERVER_LOWER%-web.exe does not exist in !%SERVER_UPPER%_MAIN!\web
pause && exit /b 1
)
if not exist "conf\web.conf" (
echo [ERROR] conf\web.conf does not exist in !%SERVER_UPPER%_MAIN!\web
pause && exit /b 1
)
:: =============================================
:: Service Launch
:: =============================================
cd ..
setlocal
echo Starting %SERVER_HUMP% Server...
jps -v | grep "\-Dserver.port=%SERVER_PORT%" | awk "{print $1}" >server.tmp
set /p pid=<server.tmp
del /f /q server.tmp 2>nul
if defined pid (
taskkill -f -pid !pid!
)
start "%SERVER_HUMP% Server" /B cmd /c "chcp 65001 && java -Dspring.profiles.active=test,mysql,redis,rocketmq,springdoc !%SERVER_UPPER%_VM_PARAMS! -jar !%SERVER_UPPER%_MANAGE_BIN!"
echo Starting %SERVER_HUMP% Website...
cd web
taskkill -f -im %SERVER_LOWER%-web.exe >nul
start "%SERVER_HUMP% Website" /B cmd /c "%SERVER_LOWER%-web.exe -c conf\web.conf"
set MAX_WAIT=300
set CHECK_INTERVAL=5
set counter=0
echo Waiting for services to start...
echo.
:CHECK_LOOP
netstat -an | find ":%SERVER_PORT%" > nul
set server_up=%errorlevel%
netstat -an | find ":%WEBSITE_PORT%" > nul
set website_up=%errorlevel%
if !server_up! equ 0 if !website_up! equ 0 (
call :DISPLAY_SUCCESS
exit /b 0
)
set /a counter+=CHECK_INTERVAL
if !counter! geq %MAX_WAIT% (
echo Error: Services did not start within !counter! seconds
exit /b 1
)
timeout /t %CHECK_INTERVAL% /nobreak > nul
goto CHECK_LOOP
:DISPLAY_SUCCESS
:: =============================================
:: Status Display
:: =============================================
echo.
echo ========================================
echo %SERVER_HUMP% Services Successfully Started
echo ========================================
echo - %SERVER_HUMP% Server (Port: %SERVER_PORT%)
echo - %SERVER_HUMP% Website (Port: %WEBSITE_PORT%)
echo ========================================
echo.
endlocal
exit /b 0

View File

@ -1,7 +1,7 @@
;iss
#define MyAppName "仿真实验"
#define MyAppVersion "1.0.1"
#define MyAppVersion "1.0.3"
#define MyAppPublisher "X"
#define MyAppURL "~"
#define MyAppExeName "simulation"