-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcreate-portable-release.bat
More file actions
133 lines (118 loc) · 3.62 KB
/
Copy pathcreate-portable-release.bat
File metadata and controls
133 lines (118 loc) · 3.62 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
@echo off
REM BlueMeter Portable Release Creator
REM This script creates a fully portable, pre-built version that doesn't require building
setlocal enabledelayedexpansion
cd /d "%~dp0"
echo.
echo ======================================
echo BlueMeter Portable Release Creator
echo ======================================
echo.
REM Check if .NET SDK is installed
where dotnet >nul 2>&1
if errorlevel 1 (
echo Error: .NET SDK not found!
echo Please install .NET 8.0 SDK first.
pause
exit /b 1
)
REM Get version from Installer.iss
for /f "tokens=2 delims==" %%a in ('findstr /c:"#define MyAppVersion" setup\Installer.iss') do (
set VERSION=%%a
set VERSION=!VERSION:"=!
set VERSION=!VERSION: =!
)
if "%VERSION%"=="" (
echo Error: Could not determine version from setup\Installer.iss
pause
exit /b 1
)
echo Building version: %VERSION%
echo.
REM Clean previous builds
echo Cleaning previous builds...
dotnet clean -c Release >nul 2>&1
REM Publish with self-contained .NET runtime
echo Publishing self-contained build...
dotnet publish BlueMeter.WPF/BlueMeter.WPF.csproj ^
-c Release ^
-r win-x64 ^
--self-contained true ^
-p:PublishSingleFile=false ^
-p:DebugType=None ^
-p:DebugSymbols=false ^
-o "release-portable\BlueMeter-v%VERSION%-portable"
if errorlevel 1 (
echo.
echo Build failed!
pause
exit /b 1
)
REM Create portable launcher
echo Creating portable launcher...
(
echo @echo off
echo cd /d "%%~dp0"
echo start "" "BlueMeter.WPF.exe"
echo exit
) > "release-portable\BlueMeter-v%VERSION%-portable\BlueMeter.bat"
REM Copy README
if exist "README.md" (
copy "README.md" "release-portable\BlueMeter-v%VERSION%-portable\README.md" >nul
)
REM Create portable-specific README
(
echo # BlueMeter Portable Edition
echo.
echo This is a pre-built, portable version of BlueMeter that does NOT require building.
echo.
echo ## Requirements
echo.
echo - Npcap ^(for packet capture^)
echo Download from: https://npcap.com/#download
echo.
echo ## How to Run
echo.
echo 1. Make sure Npcap is installed
echo 2. Double-click `BlueMeter.bat` to launch
echo.
echo ## Running in Offline/VM Environment
echo.
echo This portable version works offline! Just:
echo 1. Install Npcap once ^(requires internet for download^)
echo 2. Copy this entire folder to your offline machine/VM
echo 3. Run `BlueMeter.bat`
echo.
echo All combat data stays local - no internet connection needed for operation.
echo.
echo ## Troubleshooting
echo.
echo If BlueMeter doesn't start:
echo 1. Check that Npcap is installed
echo 2. Try running `BlueMeter.WPF.exe` directly as administrator
echo 3. Check Windows Defender isn't blocking the application
echo.
echo For more information, see the main README.md
) > "release-portable\BlueMeter-v%VERSION%-portable\PORTABLE-README.txt"
REM Create ZIP
echo Creating ZIP archive...
powershell -NoProfile -Command "Compress-Archive -Path 'release-portable\BlueMeter-v%VERSION%-portable' -DestinationPath 'release-portable\BlueMeter-v%VERSION%-portable.zip' -Force"
if errorlevel 1 (
echo Warning: Failed to create ZIP automatically
echo You can manually ZIP the folder: release-portable\BlueMeter-v%VERSION%-portable
)
echo.
echo ======================================
echo Portable release created successfully!
echo ======================================
echo.
echo Location: release-portable\BlueMeter-v%VERSION%-portable
echo ZIP file: release-portable\BlueMeter-v%VERSION%-portable.zip
echo.
echo This version:
echo - Includes .NET runtime ^(no separate installation needed^)
echo - Works completely offline
echo - Only requires Npcap
echo - Ready to run with BlueMeter.bat
echo.
pause