Files
TeslaRel410/emulator/deploy/postinstall.bat
T
CydandClaude Opus 4.8 9df87f2c01 Deploy: pod install scaffold -- supervisor entry-point, postinstall, packaging
Network-agnostic, air-gapped pod install for the two DOSBox titles (BT/RP 4.10),
fitting the existing TeslaConsole/TeslaLauncher pod-bay architecture.

emulator/DEPLOYMENT-PLAN.md
  Full design: bridge on the one NIC (pods form a source-proven P2P TCP mesh, so
  NAT/slirp is out); launcher keeps the bay IP, the DOSBox guest bridges at
  bayIP+100 (egg/mesh/game endpoint); two-edit +100 convention (postinstall +
  console DOSBox flag); static, air-gapped, <=32 pods.

emulator/pod-launch/  (C# net8 supervising entry-point)
  Creates a Job Object (KILL_ON_JOB_CLOSE), launches DOSBox-X + the render bridge
  into it and blocks -- kill this process and both die (kernel-enforced, even on
  a hard TerminateProcess of a hung session; verified). Mode dispatch: bt/rp
  wired (also serve camera + live mission-review via egg hostType); review +
  diagnostics recognized but fail clean until their DOS launch args are known.

emulator/deploy/  (install side)
  postinstall.bat (thin elevated wrapper) + configure.ps1 (NIC detect, realnic
  bind as a contiguous letter-leading GUID fragment, game IP = bayIP+100, stable
  MAC, render net_*.conf templates, stamp WATTCP.CFG my_ip) + tokenized conf
  templates + package.ps1 (assemble the zip). Render/bind/stamp + packaging
  verified against a scratch tree.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 10:36:30 -05:00

47 lines
1.9 KiB
Batchfile

@echo off
setlocal enabledelayedexpansion
REM ==========================================================================
REM postinstall.bat -- runs ELEVATED after TeslaLauncher extracts the zip to
REM the games root (C:\games). The zip root holds this file + ONE package
REM folder; this script finds that folder, installs the bundled Npcap, and
REM hands off to deploy\configure.ps1 for the NIC bind / IP derivation / conf
REM rendering. Air-gapped: nothing is downloaded. See DEPLOYMENT-PLAN.md.
REM ==========================================================================
echo [postinstall] starting
REM --- locate ROOT: the single package folder beside this script -----------
set "HERE=%~dp0"
set "ROOT="
for /d %%D in ("%HERE%*") do set "ROOT=%%~fD"
if not defined ROOT (
echo [postinstall] ERROR: no package folder found beside postinstall.bat
exit /b 1
)
echo [postinstall] ROOT=!ROOT!
REM --- 1. Npcap silent install (bundled OEM-class installer supporting /S) --
set "NPCAP=!ROOT!\deploy\npcap.exe"
if exist "!NPCAP!" (
echo [postinstall] installing Npcap silently...
"!NPCAP!" /S
if errorlevel 1 ( echo [postinstall] ERROR: Npcap install failed & exit /b 1 )
) else (
echo [postinstall] WARNING: bundled Npcap not found at "!NPCAP!"
echo [postinstall] the pcap bridge will not work without it
)
REM --- optional: bundled VC++ runtime, if present --------------------------
set "VCREDIST=!ROOT!\deploy\vc_redist.x64.exe"
if exist "!VCREDIST!" (
echo [postinstall] installing VC++ runtime...
"!VCREDIST!" /install /quiet /norestart
)
REM --- 2-4. NIC bind + WATTCP my_ip=bayIP+100 + render confs (PowerShell) ---
echo [postinstall] configuring network + rendering confs...
powershell -NoProfile -ExecutionPolicy Bypass -File "!ROOT!\deploy\configure.ps1" -Root "!ROOT!"
if errorlevel 1 ( echo [postinstall] ERROR: configure.ps1 failed & exit /b 1 )
echo [postinstall] done
exit /b 0