Repository navigation
Expand file tree
/
Copy pathdeploy.bat
More file actions
77 lines (68 loc) · 2.15 KB
/
Copy pathdeploy.bat
File metadata and controls
77 lines (68 loc) · 2.15 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
@echo off
setlocal
title WolfEQ Deploy
echo ==========================================
echo WolfEQ - Build and Launch
echo ==========================================
echo.
cd /d "%~dp0"
set "APP_NAME=WolfEQ"
set "PROJECT_FILE=WolfEQ.csproj"
set "BUILD_ROOT=%LOCALAPPDATA%\WolfEQ\deploy-build"
set "BUILD_OBJ=%BUILD_ROOT%\obj"
set "BUILD_BIN=%BUILD_ROOT%\bin"
set "APP_EXE=%BUILD_BIN%\Debug\net8.0-windows10.0.19041.0\WolfEQ.exe"
echo [1/5] Checking optional Git sync...
if exist ".git" (
git -c safe.directory=* remote get-url origin >nul 2>nul
if errorlevel 1 (
echo No origin remote configured. Skipping pull.
) else (
git -c safe.directory=* pull --ff-only
if errorlevel 1 (
echo ERROR: Git pull failed. Check your connection or local changes.
pause
exit /b 1
)
)
) else (
echo No .git folder here. Skipping pull.
)
echo.
echo [2/5] Killing old WolfEQ if running...
taskkill /f /im "%APP_NAME%.exe" 2>nul
timeout /t 2 /nobreak >nul
echo.
echo [3/5] Cleaning generated WPF build files...
rem WPF stores absolute source paths in obj. A checkout opened through both a
rem mapped drive and a UNC path can otherwise retain references to missing .g.cs files.
rem Build intermediates stay local so WPF generation is not racing over the network share.
if exist "%BUILD_OBJ%\" rmdir /s /q "%BUILD_OBJ%"
if exist "%~dp0obj\" rmdir /s /q "%~dp0obj" 2>nul
if exist "%BUILD_OBJ%\" (
echo ERROR: Could not reset the local WPF build cache:
echo %BUILD_OBJ%
echo Close any dotnet build processes, then try again.
pause
exit /b 1
)
echo.
echo [4/5] Building...
dotnet build "%PROJECT_FILE%" -c Debug --no-incremental -m:1 -p:UseSharedCompilation=false "-p:BaseIntermediateOutputPath=%BUILD_OBJ%/" "-p:BaseOutputPath=%BUILD_BIN%/"
if errorlevel 1 (
echo ERROR: Build failed. Check errors above.
pause
exit /b 1
)
echo.
echo [5/5] Launching WolfEQ...
if not exist "%APP_EXE%" (
echo ERROR: Expected app was not found:
echo %APP_EXE%
pause
exit /b 1
)
start "" "%APP_EXE%"
echo.
echo WolfEQ deployed and launched.
timeout /t 2 /nobreak >nul