Files
TeslaSuite/Launcher/build.bat
T
CydandClaude Opus 5 2a5a387381 Console: remember Enable Custom Bitmaps, ship the art; bump suite to 4.11.4.5
Settings -> Enable Custom Bitmaps was a static bool with no backing store:
it defaulted to off on every launch, so an operator had to re-tick it each
session and any custom plasma art was silently ignored until they did. New
ConsoleSettings persists machine-level menu toggles as XML in
%ProgramData%\Tesla Console\console.settings, alongside RPDefaults.rpd /
BTDefaults.btd / local.siteconfig. It is loaded once from Main and never
from a static initializer: the differential suite drives PlasmaBitmaps
directly and must keep seeing the original defaults rather than whatever
this machine has saved. A missing file is the first-run case; a corrupt one
is ignored and rewritten by the next toggle, because losing a menu setting
must never stop the console starting.

Custom art is now version-controlled and rolls with the release. New
Console\Plasma Images\ is copied into the package, and the lookup searches
%ProgramData%\Tesla Console\Plasma Images first and the exe-relative folder
second, so a release can never clobber a site's own name bitmaps.
install.bat creates the data-dir folder before the icacls grant so an
unelevated operator can write it. Ships with three 128x32 name bitmaps
(Deadmeat, Muerte, Phrogg); Muerte arrived as "Muerte_128x32-2.bmp", a name
the lookup can never build, so it is renamed to match its pilot.

Two fixes fell out of making the flag sticky. Path.Combine ran on the raw
participant name outside the try block, so with the option on a pilot named
"A:B" threw ArgumentException straight out of egg generation; names that
cannot be a Windows file name now just render procedurally. And the art was
loaded with Image.FromFile, which keeps the bitmap backed by the file and
locked for its whole lifetime — it is copied out through a stream now, so
art can be swapped between missions without restarting the console.

Verified against the built net40 exe: all three shipped bitmaps resolve by
pilot name, ProgramData wins over the shipped copy, a wrong-size file is
ignored, an illegal-character name does not throw, the file is not left
locked, and the settings round-trip and corrupt-file tolerance both hold.
Diff suite 106/106.

Version bumped 4.11.4.4 -> 4.11.4.5 across Console, Launcher, vPOD, the
install/build banners, the diff-suite version assertion and the README's
latest-release pointer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-28 13:16:11 -05:00

122 lines
5.0 KiB
Batchfile

@echo off
:: =============================================================================
:: TeslaLauncher - Unified Build / Package Script (XP11 single binary)
:: =============================================================================
:: Publishes TeslaLauncher.exe as a framework-dependent net40 build and
:: assembles the installable TeslaLauncher\ package next to install.bat.
::
:: net40 is deliberate: it is the newest .NET Framework that installs on
:: Windows XP SP3, and net40 assemblies run in-place on the 4.8 runtime built
:: into Windows 10/11 - so this ONE exe covers XP SP3 through Windows 11.
:: - XP SP3 pods additionally need the .NET Framework 4.0 redistributable
:: (dotNetFx40_Full_x86_x64.exe); drop it into assets\dotnet40\ to have
:: install.bat run it automatically when missing.
:: - Windows 10/11 pods need nothing extra.
::
:: Requirements:
:: .NET SDK (6.0+) to drive the build https://dotnet.microsoft.com/download
:: Internet access for NuGet restore (first build only)
::
:: Usage:
:: build.bat - build + package
:: build.bat /q - no pause on exit
::
:: Output (under dist\, parity with Console\dist\):
:: dist\TeslaLauncher\
:: install.bat
:: App\TeslaLauncher.exe (+ Newtonsoft.Json.dll, TeslaConsoleLaunchLib.dll)
:: dx9201006\ openal\ UltraVNC\ dotnet40\ (redist, mirrored from assets\)
:: dist\TeslaLauncher-podpkg.zip (the deployable package)
::
:: NOTE: the project references ..\Contract\Tesla.Contract.csproj, so it is
:: published IN PLACE (not staged into a temp folder) - the project reference
:: must be able to resolve relative to this directory.
:: =============================================================================
setlocal enabledelayedexpansion
set ROOT=%~dp0
set BUILD_DIR=%ROOT%dist\TeslaLauncher
set ZIP=%ROOT%dist\TeslaLauncher-podpkg.zip
set QUIET=0
for %%a in (%*) do (
if /i "%%~a"=="/q" set QUIET=1
)
echo.
echo ============================================================
echo Tesla Launcher v4.11.4.5 - Build ^& Package (net40 single binary)
echo Output : %BUILD_DIR%
echo ============================================================
echo.
:: -- Verify .NET SDK ----------------------------------------------------------
where dotnet >nul 2>&1
if errorlevel 1 (
echo ERROR: dotnet not found.
echo Install the .NET 8 SDK from:
echo https://dotnet.microsoft.com/download/dotnet/8.0
if "%QUIET%"=="0" pause
exit /b 1
)
for /f "tokens=*" %%v in ('dotnet --version 2^>^&1') do set SDK_VER=%%v
echo SDK : %SDK_VER%
echo.
:: -- Clean prior package output ----------------------------------------------
if exist "%BUILD_DIR%\App" rmdir /s /q "%BUILD_DIR%\App"
if exist "%BUILD_DIR%\Service" rmdir /s /q "%BUILD_DIR%\Service"
if exist "%BUILD_DIR%\Agent" rmdir /s /q "%BUILD_DIR%\Agent"
if exist "%BUILD_DIR%\dx9201006" rmdir /s /q "%BUILD_DIR%\dx9201006"
if exist "%BUILD_DIR%\openal" rmdir /s /q "%BUILD_DIR%\openal"
if exist "%BUILD_DIR%\UltraVNC" rmdir /s /q "%BUILD_DIR%\UltraVNC"
if exist "%BUILD_DIR%\dotnet40" rmdir /s /q "%BUILD_DIR%\dotnet40"
:: -- Build --------------------------------------------------------------------
echo [1/1] Publishing TeslaLauncher (net40 single binary)...
echo.
dotnet publish "%ROOT%TeslaLauncher.csproj" ^
-c Release ^
-o "%BUILD_DIR%\App"
if errorlevel 1 (
echo.
echo ERROR: build failed.
if "%QUIET%"=="0" pause
exit /b 1
)
echo.
echo Launcher : %BUILD_DIR%\App\TeslaLauncher.exe
echo.
:: -- Copy shared assets into the package --------------------------------------
:: Mirror each redist folder under assets\ into the package root so install.bat's
:: paths (%ROOT%\dx9201006\ etc.) resolve.
if exist "%ROOT%install.bat" copy /y "%ROOT%install.bat" "%BUILD_DIR%\" >nul
if exist "%ROOT%assets\dx9201006" xcopy /y /s /i /q "%ROOT%assets\dx9201006" "%BUILD_DIR%\dx9201006" >nul
if exist "%ROOT%assets\openal" xcopy /y /s /i /q "%ROOT%assets\openal" "%BUILD_DIR%\openal" >nul
if exist "%ROOT%assets\UltraVNC" xcopy /y /s /i /q "%ROOT%assets\UltraVNC" "%BUILD_DIR%\UltraVNC" >nul
if exist "%ROOT%assets\dotnet40" xcopy /y /s /i /q "%ROOT%assets\dotnet40" "%BUILD_DIR%\dotnet40" >nul
:: -- Zip the package ----------------------------------------------------------
echo Zipping package...
if exist "%ZIP%" del /q "%ZIP%"
powershell -NoProfile -Command "Compress-Archive -Path '%BUILD_DIR%' -DestinationPath '%ZIP%' -Force"
:: -- Summary ------------------------------------------------------------------
echo ============================================================
echo Build complete
echo ============================================================
echo.
echo Launcher : %BUILD_DIR%\App\TeslaLauncher.exe
echo.
echo Package : %BUILD_DIR%
echo Zip : %ZIP%
echo.
echo Next steps:
echo 1. Copy TeslaLauncher-podpkg.zip to the pod (XP SP3 or Win10/11) and extract
echo 2. Run TeslaLauncher\install.bat as Administrator
echo.
if "%QUIET%"=="0" pause
exit /b 0