-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.bat
More file actions
83 lines (67 loc) · 1.65 KB
/
build.bat
File metadata and controls
83 lines (67 loc) · 1.65 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
@echo off
setlocal enabledelayedexpansion
echo ========================================
echo WinGet UI Manager v2.0 - Build Script
echo ========================================
echo.
REM Check if .NET SDK is installed
dotnet --version >nul 2>&1
if errorlevel 1 (
echo ERROR: .NET SDK is not installed or not in PATH
echo Please install .NET 8.0 or later from https://dotnet.microsoft.com
exit /b 1
)
echo .NET SDK found:
dotnet --version
echo.
REM Determine build configuration
set BUILD_CONFIG=Release
if "%1"=="debug" set BUILD_CONFIG=Debug
echo Building WinGetUI in %BUILD_CONFIG% mode...
echo.
REM Change to WinGetUI directory
cd WinGetUI
REM Clean previous builds
echo Cleaning previous builds...
dotnet clean --configuration %BUILD_CONFIG% >nul 2>&1
REM Restore dependencies
echo Restoring NuGet packages...
dotnet restore
if errorlevel 1 (
echo ERROR: Failed to restore packages
cd ..
exit /b 1
)
echo.
REM Build the project
echo Building project...
dotnet build --configuration %BUILD_CONFIG% --no-restore
if errorlevel 1 (
echo ERROR: Build failed
cd ..
exit /b 1
)
cd ..
echo.
echo ========================================
echo Build completed successfully!
echo ========================================
echo.
REM Find the built executable
for /r "WinGetUI\bin\%BUILD_CONFIG%" %%F in (WinGetUI.exe) do (
set EXECUTABLE=%%F
)
if defined EXECUTABLE (
echo Output: !EXECUTABLE!
echo.
echo To run the application, execute:
echo !EXECUTABLE!
) else (
echo Build output location: WinGetUI\bin\%BUILD_CONFIG%
)
echo.
if "%1"=="run" (
echo Starting application...
start "" "!EXECUTABLE!"
)
endlocal