This repository was archived by the owner on Apr 11, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
146 lines (121 loc) · 3.54 KB
/
build.bat
File metadata and controls
146 lines (121 loc) · 3.54 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
@echo off
REM Set working directory to script location
cd /d "%~dp0"
REM Project root directory
set PROJECT_ROOT=%~dp0
set SOLUTION_FILE=src\DMM_Hide_Launcher.sln
set OUTPUT_DIR=publish
REM Title
title DMM_Hide_Launcher Build Script
:menu
cls
echo =========================================
echo DMM_Hide_Launcher Build Script
echo =========================================
echo.
echo 1. Build Normal Version
echo 2. Build WebView2 Version
echo 3. Exit
echo.
set /p CHOICE=Enter choice [1-3]:
if "%CHOICE%"=="1" goto build_normal
if "%CHOICE%"=="2" goto build_webview2
if "%CHOICE%"=="3" goto exit_script
echo Invalid choice, try again.
pause
goto menu
:build_normal
set PROJECT_FILE=src\DMM_Hide_Launcher\DMM_Hide_Launcher.csproj
goto set_build_args
:build_webview2
set PROJECT_FILE=src\DMM_Hide_Launcher_Webview2\DMM_Hide_Launcher.csproj
goto set_build_args
:set_build_args
if "%PROJECT_FILE%"=="src\DMM_Hide_Launcher\DMM_Hide_Launcher.csproj" (
set VERSION_TYPE=normal
set NATIVE_LIB=false
) else (
set VERSION_TYPE=webview2
set NATIVE_LIB=true
)
:build
cls
echo =========================================
echo Building %VERSION_TYPE% version
echo =========================================
echo.
echo 1. x86 (32-bit)
echo 2. x64 (64-bit)
echo 3. Both x86 and x64
echo.
set /p ARCH=Enter architecture [1-3]:
REM Build x86
if "%ARCH%"=="1" goto build_x86
REM Build x64
if "%ARCH%"=="2" goto build_x64
REM Build both
if "%ARCH%"=="3" goto build_both
echo Invalid architecture, try again.
pause
goto build
:build_x86
if %ERRORLEVEL% NEQ 0 (
echo Restore failed!
pause
goto menu
)
echo Building x86 version...
dotnet publish %PROJECT_FILE% -c Release -r win-x86 --no-self-contained /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=%NATIVE_LIB% /p:DebugType=None /p:TrimUnusedDependencies=true /p:IncludeAllContentForSelfExtract=false -o %OUTPUT_DIR%\%VERSION_TYPE%\x86
if %ERRORLEVEL% NEQ 0 (
echo Build failed!
pause
goto menu
)
echo Build completed!
echo Output: %OUTPUT_DIR%\%VERSION_TYPE%\x86
echo.
pause
goto menu
:build_x64
if %ERRORLEVEL% NEQ 0 (
echo Restore failed!
pause
goto menu
)
echo Building x64 version...
dotnet publish %PROJECT_FILE% -c Release -r win-x64 --no-self-contained /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=%NATIVE_LIB% /p:DebugType=None /p:TrimUnusedDependencies=true /p:IncludeAllContentForSelfExtract=false -o %OUTPUT_DIR%\%VERSION_TYPE%\x64
if %ERRORLEVEL% NEQ 0 (
echo Build failed!
pause
goto menu
)
echo Build completed!
echo Output: %OUTPUT_DIR%\%VERSION_TYPE%\x64
echo.
pause
goto menu
:build_both
echo Building x86 version...
dotnet publish %PROJECT_FILE% -c Release -r win-x86 --no-self-contained /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=%NATIVE_LIB% /p:DebugType=None /p:TrimUnusedDependencies=true /p:IncludeAllContentForSelfExtract=false -o %OUTPUT_DIR%\%VERSION_TYPE%\x86
if %ERRORLEVEL% NEQ 0 (
echo Build x86 failed!
pause
goto menu
)
echo Building x64 version...
dotnet publish %PROJECT_FILE% -c Release -r win-x64 --no-self-contained /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=%NATIVE_LIB% /p:DebugType=None /p:TrimUnusedDependencies=true /p:IncludeAllContentForSelfExtract=false -o %OUTPUT_DIR%\%VERSION_TYPE%\x64
if %ERRORLEVEL% NEQ 0 (
echo Build x64 failed!
pause
goto menu
)
echo Build completed!
echo Output: %OUTPUT_DIR%\%VERSION_TYPE%
echo.
pause
goto menu
:exit_script
echo.
echo Thank you for using DMM_Hide_Launcher Build Script!
echo Press any key to exit...
pause >nul