-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstart-all.bat
More file actions
39 lines (31 loc) · 1.12 KB
/
start-all.bat
File metadata and controls
39 lines (31 loc) · 1.12 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
@echo off
setlocal EnableExtensions
set "ROOT=%~dp0"
if "%ROOT:~-1%"=="\" set "ROOT=%ROOT:~0,-1%"
set "PACKAGE_SCRIPT=%ROOT%\scripts\publish-windows-package.ps1"
set "PACKAGE_ROOT=%ROOT%\artifacts\windows-package"
set "PACKAGE_EXE=%PACKAGE_ROOT%\SimplerJiangAiAgent.Desktop.exe"
pushd "%ROOT%" || exit /b 1
echo [1/3] Stopping existing instances...
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"Get-Process -Name SimplerJiangAiAgent.Desktop,SimplerJiangAiAgent.Api,SimplerJiangAiAgent.FinancialWorker -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue; Start-Sleep -Seconds 2"
echo [2/3] Packaging latest build...
powershell -NoProfile -ExecutionPolicy Bypass -File "%PACKAGE_SCRIPT%"
if errorlevel 1 (
echo ERROR: Packaging failed. Check build output above.
goto :fail
)
if not exist "%PACKAGE_EXE%" (
echo ERROR: Desktop executable not found: %PACKAGE_EXE%
goto :fail
)
echo [3/3] Starting SimplerJiangAiAgent Desktop...
start "" "%PACKAGE_EXE%"
echo Done. Desktop application launched. Backend will be started automatically.
popd
endlocal
exit /b 0
:fail
popd
endlocal
exit /b 1