Files
TeslaSuite/Launcher
CydandClaude Fable 5 8730b9b966 XP11: single net40 binary runs on XP SP3 through Windows 11
Merge TeslaLauncherService (Session 0) + TeslaLauncherAgent (tray) into one
userland TeslaLauncher.exe. The split existed only to work around Vista+
Session 0 isolation; running everything in the auto-logged-in admin session
needs no service, no named pipe, and no flat<->wire conversion layer. The
original Elsewhen software was likewise a single binary.

net40 is the newest framework XP SP3 can install, and net40 assemblies load
in-place on the 4.8 runtime in Win10/11 -- one exe covers both.

- Contract: multi-target net48;net40. The net40 leg of PodRpcProtocol uses
  Newtonsoft.Json (STJ has no net40 target); JSON is shape-identical on the
  wire, and the request reader keeps date strings raw so Ping echoes
  byte-identically. Console keeps the untouched net48/STJ leg.
- MiniZip.cs: central-directory ZIP extractor (stored/deflate/ZIP64) since
  net40 has no ZipFile; zip-slip guarded.
- SecureConfig: RSACryptoServiceProvider instead of RSA.Create (net46+),
  no leaveOpen BinaryWriter/Reader, struct instead of ValueTuple, and no
  SetCompatibleTextRenderingDefault on the passcode thread (the merged app
  already has a form). netsh "interface ip" syntax was already XP-correct.
- Volume: nircmd -> CoreAudio (Vista+) -> winmm waveOutSetVolume (XP).
- Paths: CommonApplicationData resolved per-OS (XP has no C:\ProgramData);
  launcher log moved next to the key/config in the data dir.
- install.bat: dual-OS (cacls/icacls, netsh firewall/advfirewall, dism and
  UAC/notification steps skipped on XP, .NET 4.0 redist check, XP DHCP reset
  via netsh); no service registration -- HKLM Run key + auto-login on both;
  RegisterApplicationRestart supplies crash-restart on Vista+.
- Bench switches: /skipconfig, /port:NNNN.

Verified: Console + diff suite (103 tests) still green on the net48 leg;
E2E smoke test drove the net40 launcher over real TCP with the Console's own
PodManagerConnection (STJ client vs Newtonsoft server) -- Ping echo, volume,
app registry, launch/kill/watch, InstallProduct zip transfer + extract, and
uninstall orphan cleanup: 17/17 pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 18:59:06 -05:00
..

TeslaLauncher (XP11 — single binary)

.NET Framework 4.0 (framework-dependent) rewrite of the original Elsewhen Studios LLC software. One TeslaLauncher.exe runs on Windows XP SP3 through Windows 11: net40 is the newest framework XP can install, and net40 assemblies load in-place on the 4.8 runtime built into Windows 10/11. XP pods need the .NET 4.0 redistributable (installed automatically by install.bat when dotnet40\ is in the package); Win10/11 pods need nothing extra.

Architecture

One userland tray application — no Windows Service, no IPC.

The original Elsewhen software was a single service (on Win2k/XP a service could still touch the desktop). The modern rewrite split it into Service + Agent purely to work around Vista+ Session 0 isolation. XP11 closes the loop: everything runs in the auto-logged-in kiosk session, where the desktop, audio, and game processes live anyway.

TeslaLauncher (WinForms tray app, user session)

  • Listens on TCP 53290 for OFB-encrypted framed-JSON RPC from TeslaConsole
  • Handles first-boot network configuration (SecureConfig) and shows the Request ID / Passphrase on screen + COM2 plasma
  • Handles game file transfers from the Console (InstallProduct → C:\Games, postinstall.bat, pre-uninstall.bat on uninstall)
  • Launches/kills/watches simulation apps, controls volume, manages LaunchApps.xml
  • Registers with WER for restart-after-crash (Vista+; no-op on XP)

Requires the kiosk account (Firestorm) to be in Administrators — SecureConfig's netsh/hostname writes and product postinstall.bat driver installs need the admin token (UAC is disabled by the installer on modern Windows, so no prompts).

SecureConfig (first-boot protocol)

  • Assigns a temporary IP and broadcasts a UDP beacon so the Console can discover the pod
  • Operator reads the Passphrase off the pod screen and enters it into the Console
  • Console sends AES-encrypted network configuration (IP, mask, gateway, DNS, hostname)
  • TCP handshake establishes an OFB-encrypted session with RSA key exchange
  • Session key is saved for all subsequent Console connections

Uses the old-style netsh interface ip commands throughout — they update the live TCP/IP stack immediately and are the only form XP understands.

Communication Flow

TeslaConsole ──TCP 53290 (OFB + framed JSON)──> TeslaLauncher.exe (user session)

Files

File Description
TeslaLauncher.cs The whole launcher: tray, TCP listener, RPC dispatch, install, processes, volume
TeslaLauncher.csproj net40 WinForms exe project
MiniZip.cs Central-directory ZIP extractor (net40 has no ZipFile; stored + deflate + ZIP64)
SecureConfig.cs First-boot secure configuration protocol + OFB duplex stream
build.bat Builds + assembles the package
install.bat Dual-OS installer (XP SP3 and Win10/11 code paths; run as Administrator)

Building

Requirements:

  • .NET SDK (6.0+) to drive the build
  • Internet access for NuGet restore (first build only)
build.bat              :: build + assemble the package

Output goes to dist\TeslaLauncher\ (with App\ plus install.bat and redist folders) and dist\TeslaLauncher-podpkg.zip. The project is published in place (framework-dependent net40) — it references ../Contract, so it cannot be staged into a temp folder. App\ holds the exe plus Newtonsoft.Json.dll and TeslaConsoleLaunchLib.dll (the net40 leg of the shared contract).

Bench-testing switches

TeslaLauncher.exe /skipconfig      :: skip the DHCP SecureConfig gate
TeslaLauncher.exe /port:53291      :: listen on a non-standard port

Installation

  1. Copy the TeslaLauncher\ folder to each cockpit PC (XP SP3 or Win10/11)
  2. Run TeslaLauncher\install.bat as Administrator

The installer detects the OS and branches where the tooling differs:

Step XP SP3 Windows 10/11
.NET installs 4.0 redist from dotnet40\ if missing 4.8 built in — nothing
ACLs cacls icacls
Firewall off netsh firewall netsh advfirewall
SMB1 / DirectPlay native — skipped dism /Enable-Feature
DHCP reset netsh interface ip set address ... dhcp PowerShell Set-NetIPInterface
Notifications / UAC n/a policy keys + EnableLUA=0
UltraVNC UltraVNC_x86_Setup.exe (if bundled) UltraVNC_x64_Setup.exe

Common to both: auto-login (Firestorm), HKLM Run key for the launcher (no service registration), C:\Games + data dir creation, shares, workgroup, power settings, reboot.

First Boot

  1. Cockpit boots with DHCP (unconfigured state), auto-logs into the kiosk account
  2. Launcher runs SecureConfig: broadcasts beacon, displays codes on screen + plasma
  3. Console operator sees the pod's Request ID and enters the Passphrase
  4. Console sends encrypted network configuration
  5. Pod applies the configuration and is ready for normal operation

Normal Operation

The Console connects to each configured pod on TCP 53290 and can:

  • Install/uninstall simulation games
  • Launch/kill applications
  • Get/set volume level
  • Query pod status (FullUpdate)
  • Shutdown or reboot the pod

Key Paths

<CommonAppData> is C:\ProgramData on Vista+, and C:\Documents and Settings\All Users\Application Data on XP — the launcher and installer both resolve it per-OS; nothing hardcodes C:\ProgramData anymore.

Path Purpose
<CommonAppData>\TeslaLauncher\TeslaKeyStore.key Session key (32 bytes)
<CommonAppData>\TeslaLauncher\LaunchApps.xml Installed games registry (same XML shape as the two-process Agent wrote)
<CommonAppData>\TeslaLauncher\podconf.log Launcher log (was next to the exe pre-XP11)
<CommonAppData>\TeslaLauncher\configuring.json Transient: SecureConfig codes (kept for external diagnostics)
C:\Games\ Game installation directory

Wire Protocol

The Console talks to the launcher with length-prefixed JSON frames over the OFB-encrypted TCP stream (dispatch by method name) — see ../Contract/PodRpcProtocol.cs, shared by both ends. The Contract multi-targets net48;net40: the Console's net48 leg serializes with System.Text.Json, the launcher's net40 leg with Newtonsoft.Json (STJ has no net40 target). The JSON is shape-identical on the wire; the request reader keeps date strings raw so a Ping echo returns byte-identical.

Volume on XP falls back from CoreAudio (Vista+) to nircmd.exe / winmm waveOutSetVolume.