Repository navigation
Expand file tree
/
Copy pathbuild-lite.cmd
More file actions
52 lines (42 loc) · 1.45 KB
/
Copy pathbuild-lite.cmd
File metadata and controls
52 lines (42 loc) · 1.45 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
@echo off
setlocal enabledelayedexpansion
cd /d "%~dp0"
echo.
echo ========================================
echo Building Performance Monitor Lite
echo ========================================
echo.
:: Get version from the one file that declares it (#3222)
for /f %%a in ('powershell -Command "([xml](Get-Content Directory.Build.props)).Project.PropertyGroup.Version | Where-Object { $_ }"') do set VERSION=%%a
if "%VERSION%"=="" (
echo ERROR: Could not determine version from Directory.Build.props.
exit /b 1
)
echo Version: %VERSION%
echo.
:: Clean and publish
echo Publishing Lite Edition...
dotnet publish Lite\PerformanceMonitorLite.csproj -c Release -o publish\Lite
if %ERRORLEVEL% neq 0 (
echo.
echo ERROR: Build failed!
exit /b 1
)
:: Portable ZIP for advanced / air-gapped users. README points end users at Setup.exe (Velopack)
:: because that registers shortcuts + Apps & Features; this is the explicit fallback.
echo.
echo Creating ZIP package...
set ZIPNAME=PerformanceMonitorLite-%VERSION%.zip
if exist "releases\%ZIPNAME%" del "releases\%ZIPNAME%"
if not exist "releases" mkdir releases
powershell -Command "Compress-Archive -Path 'publish\Lite\*' -DestinationPath 'releases\%ZIPNAME%' -Force"
echo.
echo ========================================
echo Build Complete!
echo ========================================
echo.
echo Output: releases\%ZIPNAME%
echo.
:: Show size
for %%A in ("releases\%ZIPNAME%") do echo Size: %%~zA bytes
endlocal