启动脚本
This commit is contained in:
parent
c8e52b9fb4
commit
7248d9c4cf
@ -1,18 +1,128 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001
|
setlocal enabledelayedexpansion
|
||||||
title Eval Quick Start
|
chcp 65001 >nul
|
||||||
|
|
||||||
cd %EVAL_MAIN%
|
set SERVER_UPPER=EVAL
|
||||||
if exist "%EVAL_MANAGE%" (
|
set SERVER_LOWER=eval
|
||||||
start "Eval Server" cmd /k "java -jar %EVAL_VM_PARAMS% -jar %EVAL_MANAGE_BIN%"
|
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%" (
|
if %modifyTitle% equ 1 (
|
||||||
start "Eval Website" cmd /k "cd web && eval-web.exe -c conf/web.conf"
|
title %SERVER_HUMP% Quick Start
|
||||||
)
|
)
|
||||||
|
|
||||||
echo Eval:
|
:: =============================================
|
||||||
echo - EvalServer (Port: 28480)
|
:: Validation
|
||||||
echo - EvalWebsite (Port: 18480)
|
:: =============================================
|
||||||
|
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
|
@ -1,7 +1,7 @@
|
|||||||
;iss
|
;iss
|
||||||
|
|
||||||
#define MyAppName "效能评估"
|
#define MyAppName "效能评估"
|
||||||
#define MyAppVersion "1.0.2"
|
#define MyAppVersion "1.0.3"
|
||||||
#define MyAppPublisher "X"
|
#define MyAppPublisher "X"
|
||||||
#define MyAppURL "~"
|
#define MyAppURL "~"
|
||||||
#define MyAppExeName "eval"
|
#define MyAppExeName "eval"
|
||||||
|
@ -1,18 +1,128 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001
|
setlocal enabledelayedexpansion
|
||||||
title Model Quick Start
|
chcp 65001 >nul
|
||||||
|
|
||||||
cd %MODEL_MAIN%
|
set SERVER_UPPER=MODEL
|
||||||
if exist "%MODEL_MANAGE_BIN%" (
|
set SERVER_LOWER=model
|
||||||
start "Model Server" cmd /k "java -jar %MODEL_VM_PARAMS% -jar %MODEL_MANAGE_BIN%"
|
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%" (
|
if %modifyTitle% equ 1 (
|
||||||
start "Model Website" cmd /k "cd web && model-web.exe -c conf/web.conf"
|
title %SERVER_HUMP% Quick Start
|
||||||
)
|
)
|
||||||
|
|
||||||
echo Model:
|
:: =============================================
|
||||||
echo - ModelServer (Port: 28680)
|
:: Validation
|
||||||
echo - ModelWebsite (Port: 18680)
|
:: =============================================
|
||||||
|
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
|
@ -1,7 +1,7 @@
|
|||||||
;iss
|
;iss
|
||||||
|
|
||||||
#define MyAppName "模型管理"
|
#define MyAppName "模型管理"
|
||||||
#define MyAppVersion "1.0.1"
|
#define MyAppVersion "1.0.2"
|
||||||
#define MyAppPublisher "X"
|
#define MyAppPublisher "X"
|
||||||
#define MyAppURL "~"
|
#define MyAppURL "~"
|
||||||
#define MyAppExeName "model"
|
#define MyAppExeName "model"
|
||||||
|
@ -1,18 +1,134 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001
|
setlocal enabledelayedexpansion
|
||||||
title Scenario Quick Start
|
chcp 65001 >nul
|
||||||
|
|
||||||
cd %SCENARIO_MAIN%
|
set SERVER_UPPER=SCENARIO
|
||||||
if exist "%SCENARIO_MANAGE_BIN%" (
|
set SERVER_LOWER=scenario
|
||||||
start "Scenario Server" cmd /k "java -jar %SCENARIO_VM_PARAMS% -jar %SCENARIO_MANAGE_BIN%"
|
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%" (
|
if %modifyTitle% equ 1 (
|
||||||
start "Scenario Website" cmd /k "cd web && scenario-web.exe -c conf/web.conf"
|
title %SERVER_HUMP% Quick Start
|
||||||
)
|
)
|
||||||
|
|
||||||
echo Scenario:
|
:: =============================================
|
||||||
echo - ScenarioServer (Port: 28880)
|
:: Validation
|
||||||
echo - ScenarioWebsite (Port: 18880)
|
:: =============================================
|
||||||
|
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
|
@ -1,7 +1,7 @@
|
|||||||
;iss
|
;iss
|
||||||
|
|
||||||
#define MyAppName "想定筹划"
|
#define MyAppName "想定筹划"
|
||||||
#define MyAppVersion "1.0.1"
|
#define MyAppVersion "1.0.3"
|
||||||
#define MyAppPublisher "X"
|
#define MyAppPublisher "X"
|
||||||
#define MyAppURL "~"
|
#define MyAppURL "~"
|
||||||
#define MyAppExeName "scenario"
|
#define MyAppExeName "scenario"
|
||||||
|
@ -1,19 +1,128 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
setlocal enabledelayedexpansion
|
||||||
chcp 65001 >nul
|
chcp 65001 >nul
|
||||||
title Simulation Quick Start
|
|
||||||
|
|
||||||
cd %SIMULATION_MAIN%
|
set SERVER_UPPER=SIMULATION
|
||||||
if exist "%SIMULATION_MANAGE_BIN%" (
|
set SERVER_LOWER=simulation
|
||||||
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_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%" (
|
if %modifyTitle% equ 1 (
|
||||||
cd web
|
title %SERVER_HUMP% Quick Start
|
||||||
start "Simulation Website" cmd /k "title Simulation Website && simulation-web.exe -c conf/web.conf"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
echo Simulation:
|
:: =============================================
|
||||||
echo - SimulationServer (Port: 28280)
|
:: Validation
|
||||||
echo - SimulationWebsite (Port: 18280)
|
:: =============================================
|
||||||
|
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
|
@ -1,7 +1,7 @@
|
|||||||
;iss
|
;iss
|
||||||
|
|
||||||
#define MyAppName "仿真实验"
|
#define MyAppName "仿真实验"
|
||||||
#define MyAppVersion "1.0.1"
|
#define MyAppVersion "1.0.3"
|
||||||
#define MyAppPublisher "X"
|
#define MyAppPublisher "X"
|
||||||
#define MyAppURL "~"
|
#define MyAppURL "~"
|
||||||
#define MyAppExeName "simulation"
|
#define MyAppExeName "simulation"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user