Files
CydandClaude Fable 5 91640dcbf2 XP11: whole suite on net40 — Console + vPOD run on XP SP3 through Win11
The Launcher's XP11 port (8730b9b) now extends to everything: one net40
flavor across Console, vPOD, Contract, and SecureConfig (Newtonsoft.Json
everywhere; the net48/System.Text.Json legs and their #if splits are gone
since nothing consumed them).

Console (net40, single TFM like the Launcher):
- The ~31 BinaryFormatter bitmap blobs in the .resx files became raw
  embedded files under assets/icons/ (extracted byte-faithfully via a
  serialization surrogate — the animated square_throbber.gif survives),
  loaded by Properties.Resources.EmbeddedBitmap/EmbeddedIcon. Reason:
  System.Resources.Extensions' DeserializingResourceReader is net461+
  and cannot load on net40. Strings stay in the .resx.
- IReadOnlyList -> IList in AppRegistry (net45+ interface).

vPOD (net40, single TFM):
- Zip extraction now shares the Launcher's MiniZip.cs (linked source), so
  the diff-test install round-trip exercises it against ZipArchive zips.
- RPC args as JTokens; LaunchApps.json persistence via Newtonsoft;
  Thread.VolatileRead instead of Volatile.Read.

Contract/SecureConfig: net40-only; Client/** (PodManagerConnection) now
ships in the one build. The Launcher package gains
TeslaSecureConfiguration.dll as a dependency of the client half.

Tests: the net48 xunit host loads the net40 assemblies (both CLR4), so
the suite exercises exactly what ships — 106/106 green. Also verified
live: net40 console provisioned, managed, and ran a full RP mission
against net40 vPOD (beacon/passphrase/RSA, 53290 RPC, egg load,
Run/Stop Mission).

Version: 4.11.4.3 across Launcher, Console, and vPOD (vPOD joins the
suite version line; was 1.0.0). Ship the dotNetFx40 redistributable in
Launcher/assets for XP-era pods.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 21:01:34 -05:00

345 lines
16 KiB
Batchfile

@echo off
:: =============================================================================
:: TeslaLauncher Modern - Installation Script (XP11 single binary, dual-OS)
:: =============================================================================
:: Run as Administrator on each cockpit PC. Works on Windows XP SP3 and on
:: Windows 10/11 - one binary, one installer, two OS code paths where the
:: tooling differs (cacls/icacls, netsh firewall/advfirewall, no dism on XP...).
:: Must be run from the TeslaLauncher\ folder produced by build.bat:
::
:: TeslaLauncher\
:: install.bat <- this file
:: App\TeslaLauncher.exe (net40 single binary)
:: dx9201006\DXSETUP.exe (DirectX June 2010 redist)
:: openal\oalinst.exe (OpenAL redist)
:: UltraVNC\UltraVNC_x64_Setup.exe (UltraVNC server, Win10/11)
:: UltraVNC\UltraVNC_x86_Setup.exe (optional: UltraVNC for XP)
:: dotnet40\dotNetFx40_Full_x86_x64.exe (optional: .NET 4.0 for XP)
:: =============================================================================
setlocal enabledelayedexpansion
echo ============================================================
echo Tesla Launcher v4.11.4.3 - Installation (single binary)
echo ============================================================
echo.
:: -- OS detection --------------------------------------------------------------
:: NT 5.x = XP / Server 2003 era. Everything else is treated as modern Windows.
set ISXP=0
ver | findstr /r /c:"Version 5\." >nul && set ISXP=1
if "%ISXP%"=="1" (echo OS : Windows XP era ^(NT 5.x^)) else (echo OS : Windows Vista or later)
echo.
:: -- Paths ----------------------------------------------------------------------
set ROOT=%~dp0
set APP_SRC=%ROOT%App
set INSTALL_DIR=%ProgramFiles%\TeslaLauncher
set LAUNCHER_EXE=%INSTALL_DIR%\TeslaLauncher.exe
set CONSOLE_PORT=53290
:: CommonApplicationData differs by OS. The launcher resolves it via
:: Environment.GetFolderPath; these must match what it computes.
if "%ISXP%"=="1" (
set DATA_DIR=%ALLUSERSPROFILE%\Application Data\TeslaLauncher
) else (
set DATA_DIR=%ALLUSERSPROFILE%\TeslaLauncher
)
:: Auto-login account for the cockpit (kiosk). Plain-text password in the
:: registry is by design here - closed network, single-purpose PC.
set AUTOLOGIN_USER=Firestorm
set AUTOLOGIN_PASS=thor6
:: Workgroup every pod on this site joins. Keep it the same across all pods so
:: the mw4files / c shares browse cleanly. Change once per site if needed.
set WORKGROUP=Tesla
:: -- Admin check -----------------------------------------------------------------
net session >nul 2>&1
if %errorlevel% neq 0 (
echo ERROR: This script must be run as Administrator.
pause & exit /b 1
)
:: -- Verify source files ---------------------------------------------------------
if not exist "%APP_SRC%\TeslaLauncher.exe" (
echo ERROR: TeslaLauncher.exe not found in %APP_SRC%
echo Run build.bat first, then run install.bat from the TeslaLauncher\ folder.
pause & exit /b 1
)
:: -- .NET Framework 4.0 check (XP ships no .NET; Win10/11 has 4.8 built in) ------
reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" /v Install >nul 2>&1
if not errorlevel 1 goto :dotnet_ok
reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client" /v Install >nul 2>&1
if not errorlevel 1 goto :dotnet_ok
if exist "%ROOT%dotnet40\dotNetFx40_Full_x86_x64.exe" (
echo .NET Framework 4.0 not found - installing it now ^(takes a few minutes^)...
"%ROOT%dotnet40\dotNetFx40_Full_x86_x64.exe" /q /norestart
echo .NET Framework 4.0 installed.
) else (
echo ERROR: .NET Framework 4.0 is not installed and dotnet40\ redist is not
echo in this package. Install dotNetFx40_Full_x86_x64.exe first.
pause & exit /b 1
)
:dotnet_ok
:: -- Detect and clean up existing installation -----------------------------------
echo Cleaning up any existing installation...
:: Stop launcher / legacy agent processes
taskkill /F /IM TeslaLauncher.exe >nul 2>&1
taskkill /F /IM TeslaLauncherAgent.exe >nul 2>&1
:: Remove the legacy two-process service registration (pre-XP11 installs)
sc stop "Tesla Application Launcher" >nul 2>&1
ping -n 4 127.0.0.1 >nul
sc delete "Tesla Application Launcher" >nul 2>&1
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v TeslaLauncherAgent /f >nul 2>&1
:: Delete old executables, logs, and session key so SecureConfig re-runs
if exist "%LAUNCHER_EXE%" (
del /F /Q "%INSTALL_DIR%\*.exe" >nul 2>&1
del /F /Q "%INSTALL_DIR%\*.dll" >nul 2>&1
del /F /Q "%INSTALL_DIR%\podconf.log" >nul 2>&1
)
del /F /Q "%INSTALL_DIR%\TeslaLauncherService.exe" >nul 2>&1
del /F /Q "%INSTALL_DIR%\TeslaLauncherAgent.exe" >nul 2>&1
del /F /Q "%DATA_DIR%\TeslaKeyStore.key" >nul 2>&1
del /F /Q "%DATA_DIR%\LaunchApps.xml" >nul 2>&1
del /F /Q "%DATA_DIR%\configuring.json" >nul 2>&1
del /F /Q "%DATA_DIR%\podconf.log" >nul 2>&1
echo Old executables, logs, session key, and app config deleted.
:: Reset all Ethernet adapters to DHCP so the SecureConfig protocol triggers
:: on the next boot. The static address entry must be REMOVED, not just the
:: DHCP flag flipped, or IsMachineConfigured() still sees a static adapter.
echo Resetting network adapters to DHCP...
if "%ISXP%"=="1" (
rem XP: netsh "interface ip set address <name> dhcp" clears the static entry.
rem Enumerate interface names from "netsh interface show interface" (col 4+).
for /f "skip=3 tokens=4*" %%i in ('netsh interface show interface') do (
if "%%j"=="" (
netsh interface ip set address "%%i" dhcp >nul 2>&1
netsh interface ip set dns "%%i" dhcp >nul 2>&1
) else (
netsh interface ip set address "%%i %%j" dhcp >nul 2>&1
netsh interface ip set dns "%%i %%j" dhcp >nul 2>&1
)
)
) else (
powershell -NoProfile -Command "Get-NetAdapter -Physical | Where-Object {$_.Status -eq 'Up'} | ForEach-Object { $n=$_.Name; Get-NetIPAddress -InterfaceAlias $n -AddressFamily IPv4 -EA 0 | Where-Object {$_.PrefixOrigin -ne 'WellKnown' -and $_.PrefixOrigin -ne 'Dhcp'} | Remove-NetIPAddress -Confirm:$false -EA 0; Set-NetIPInterface -InterfaceAlias $n -Dhcp Enabled -EA 0 }; Get-NetAdapter -Physical | Where-Object {$_.Status -eq 'Up'} | Set-DnsClientServerAddress -ResetServerAddresses" >nul 2>&1
)
echo Network adapters reset to DHCP.
echo.
:: -- STEP 1: Create directories ---------------------------------------------------
echo [1/7] Creating directories...
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"
if not exist "%DATA_DIR%" mkdir "%DATA_DIR%"
if not exist "C:\Games" mkdir "C:\Games"
:: Grant Users modify access to the data and games directories so the launcher
:: can write files (LaunchApps.xml, session key, game installs) from any account.
if "%ISXP%"=="1" (
cacls "%DATA_DIR%" /T /E /G Users:C >nul 2>&1
cacls "C:\Games" /T /E /G Users:C >nul 2>&1
) else (
icacls "%DATA_DIR%" /grant *S-1-5-32-545:(OI)(CI)M /T >nul 2>&1
icacls "C:\Games" /grant *S-1-5-32-545:(OI)(CI)M /T >nul 2>&1
)
echo %INSTALL_DIR%
echo %DATA_DIR% (Users: modify access)
echo C:\Games (Users: modify access)
:: -- STEP 2: Copy files ------------------------------------------------------------
echo [2/7] Copying files...
:: net40 framework-dependent build: the folder holds the exe + its dependency
:: DLLs (Newtonsoft.Json, TeslaConsoleLaunchLib) + .config.
copy /Y "%APP_SRC%\*.*" "%INSTALL_DIR%\" >nul
:: Install DirectX June 2010 runtime (required by games; supports XP and Win10/11)
if exist "%ROOT%dx9201006\DXSETUP.exe" (
echo Installing DirectX runtime...
"%ROOT%dx9201006\DXSETUP.exe" /silent
echo DirectX installed.
)
:: Install OpenAL runtime (required by game audio)
if exist "%ROOT%openal\oalinst.exe" (
echo Installing OpenAL runtime...
"%ROOT%openal\oalinst.exe" /s
echo OpenAL installed.
)
:: Install UltraVNC server (remote diagnostics). x64 build for modern Windows;
:: XP uses the x86 build when the package carries one.
set UVNC_SETUP=
if "%ISXP%"=="1" (
if exist "%ROOT%UltraVNC\UltraVNC_x86_Setup.exe" set UVNC_SETUP=%ROOT%UltraVNC\UltraVNC_x86_Setup.exe
) else (
if exist "%ROOT%UltraVNC\UltraVNC_x64_Setup.exe" set UVNC_SETUP=%ROOT%UltraVNC\UltraVNC_x64_Setup.exe
)
if defined UVNC_SETUP (
echo Installing UltraVNC server...
start "" /wait "%UVNC_SETUP%" /verysilent /norestart /loadinf="%ROOT%UltraVNC\UltraVNC.inf"
) else (
if "%ISXP%"=="1" echo UltraVNC x86 setup not in package - skipped on XP.
)
:: SMB1 + DirectPlay: native on XP; must be re-enabled on Win10/11.
if "%ISXP%"=="0" (
echo Enabling SMB1 file sharing ^(client + server^)...
dism /Online /Enable-Feature /FeatureName:SMB1Protocol /All /NoRestart >nul 2>&1
dism /Online /Enable-Feature /FeatureName:SMB1Protocol-Client /All /NoRestart >nul 2>&1
dism /Online /Enable-Feature /FeatureName:SMB1Protocol-Server /All /NoRestart >nul 2>&1
echo SMB1 client + server enabled ^(reboot required to take effect^).
echo Enabling DirectPlay...
dism /Online /Enable-Feature /FeatureName:DirectPlay /All /NoRestart >nul 2>&1
echo DirectPlay enabled.
) else (
echo SMB1 and DirectPlay are native on XP - nothing to enable.
)
:: Create and share game-data folders (closed network - open to Everyone).
echo Creating network shares...
if not exist "C:\mw4files" mkdir "C:\mw4files"
if "%ISXP%"=="1" (
cacls "C:\mw4files" /T /E /G Everyone:C >nul 2>&1
) else (
icacls "C:\mw4files" /grant *S-1-1-0:(OI)(CI)M /T >nul 2>&1
)
net share mw4files /delete >nul 2>&1
net share mw4files=C:\mw4files /grant:Everyone,FULL >nul 2>&1
echo "Share \\%COMPUTERNAME%\mw4files -> C:\mw4files (Everyone: Full)"
net share c /delete >nul 2>&1
net share c=C:\ /grant:Everyone,FULL >nul 2>&1
echo "Share \\%COMPUTERNAME%\c -> C:\ (Everyone: Full)"
:: Join the site workgroup so every pod shares one browse list.
echo Joining workgroup "%WORKGROUP%"...
if "%ISXP%"=="1" (
wmic computersystem where "name='%COMPUTERNAME%'" call joindomainorworkgroup name="%WORKGROUP%" >nul 2>&1
) else (
powershell -NoProfile -Command "try { Add-Computer -WorkgroupName '%WORKGROUP%' -Force -ErrorAction Stop } catch { }" >nul 2>&1
)
echo Workgroup set to "%WORKGROUP%" (effective after reboot).
echo Done.
:: -- STEP 3: Launcher auto-start (no Windows Service on XP11) ----------------------
echo [3/7] Configuring launcher auto-start...
:: The single binary runs in the auto-logged-in user session. Restart-after-crash
:: comes from RegisterApplicationRestart (Vista+) inside the launcher itself.
set AUTORUN_KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
reg add "%AUTORUN_KEY%" /v "TeslaLauncher" /t REG_SZ ^
/d "\"%LAUNCHER_EXE%\"" /f >nul
echo Added TeslaLauncher to HKLM\...\Run (no service - single userland binary).
:: -- STEP 4: Disable Windows Firewall (closed network) -----------------------------
echo.
echo [4/7] Disabling Windows Firewall (closed network)...
if "%ISXP%"=="1" (
netsh firewall set opmode mode=disable >nul 2>&1
) else (
netsh advfirewall set allprofiles state off >nul
)
echo Windows Firewall disabled.
:: -- STEP 5: Power settings (max performance, no sleep) ----------------------------
echo.
echo [5/7] Configuring power settings...
if "%ISXP%"=="1" (
powercfg /setactive "Always On" >nul 2>&1
powercfg /change "Always On" /monitor-timeout-ac 0 >nul 2>&1
powercfg /change "Always On" /disk-timeout-ac 0 >nul 2>&1
powercfg /change "Always On" /standby-timeout-ac 0 >nul 2>&1
powercfg /hibernate off >nul 2>&1
echo "Always On" power scheme activated; sleep/hibernate disabled.
) else (
powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 >nul 2>&1
for /f "tokens=4" %%g in ('powercfg -list ^| findstr /i "Ultimate"') do (
powercfg -setactive %%g
)
powercfg -change -standby-timeout-ac 0
powercfg -change -hibernate-timeout-ac 0
powercfg -change -monitor-timeout-ac 0
powercfg -change -disk-timeout-ac 0
powercfg -h off >nul 2>&1
echo Ultimate Performance plan activated; sleep/hibernate disabled.
)
:: -- STEP 6: Quiet the OS (notifications / UAC - modern Windows only) --------------
echo.
echo [6/7] Disabling notifications and UAC...
if "%ISXP%"=="1" (
echo XP has no Action Center or UAC - nothing to disable.
) else (
rem Machine-wide Group Policy keys (HKLM) so they apply to EVERY user,
rem including the auto-login kiosk account.
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" ^
/v DisableNotificationCenter /t REG_DWORD /d 1 /f >nul
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" ^
/v NoToastApplicationNotification /t REG_DWORD /d 1 /f >nul
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" ^
/v NoToastApplicationNotificationOnLockScreen /t REG_DWORD /d 1 /f >nul
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" ^
/v NoCloudApplicationNotification /t REG_DWORD /d 1 /f >nul
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" ^
/v DisableSoftLanding /t REG_DWORD /d 1 /f >nul
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" ^
/v DisableWindowsSpotlightFeatures /t REG_DWORD /d 1 /f >nul
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent" ^
/v DisableWindowsConsumerFeatures /t REG_DWORD /d 1 /f >nul
reg add "HKLM\SOFTWARE\Microsoft\Windows Defender Security Center\Notifications" ^
/v DisableNotifications /t REG_DWORD /d 1 /f >nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" ^
/v EnableLUA /t REG_DWORD /d 0 /f >nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" ^
/v ConsentPromptBehaviorAdmin /t REG_DWORD /d 0 /f >nul
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" ^
/v PromptOnSecureDesktop /t REG_DWORD /d 0 /f >nul
echo Notifications disabled; UAC disabled ^(takes effect after reboot^).
)
:: -- STEP 7: Auto-login --------------------------------------------------------------
echo.
echo [7/7] Configuring auto-login...
:: Winlogon reads these on every boot (same keys since NT). AutoAdminLogon=1
:: signs DefaultUserName in with DefaultPassword without a prompt.
set WINLOGON=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
reg add "%WINLOGON%" /v AutoAdminLogon /t REG_SZ /d "1" /f >nul
reg add "%WINLOGON%" /v DefaultUserName /t REG_SZ /d "%AUTOLOGIN_USER%" /f >nul
reg add "%WINLOGON%" /v DefaultPassword /t REG_SZ /d "%AUTOLOGIN_PASS%" /f >nul
reg add "%WINLOGON%" /v DefaultDomainName /t REG_SZ /d "." /f >nul
:: Re-arm auto-login after every sign-out (kiosk should never sit at a prompt).
reg add "%WINLOGON%" /v ForceAutoLogon /t REG_SZ /d "1" /f >nul
:: Clear any logon-count cap that would disable auto-login after N boots.
reg delete "%WINLOGON%" /v AutoLogonCount /f >nul 2>&1
if "%ISXP%"=="0" (
rem Some Win10/11 builds require this flag off for a plain-text auto-login
rem password to be honored (device-passwordless preference).
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device" ^
/v DevicePasswordLessBuildVersion /t REG_DWORD /d 0 /f >nul 2>&1
)
echo Auto-login configured for user "%AUTOLOGIN_USER%".
:: -- Done ----------------------------------------------------------------------------
echo.
echo ============================================================
echo Installation Complete!
echo ============================================================
echo.
echo Installed to : %INSTALL_DIR%
echo Config dir : %DATA_DIR%
echo Firewall : disabled (closed network)
echo.
echo Rebooting in 10 seconds...
echo The launcher starts automatically at login (single binary, no service).
echo On first boot with DHCP, SecureConfig runs automatically -
echo watch plasma or the main screen for the Request ID and Passphrase.
echo.
echo After reboot: use Console to install apps.
echo.
shutdown /r /t 10