Files
riojoy/deploy/postinstall.bat
T
CydandClaude Fable 5 2ecb617c09 Phase 8D: universal deployment package (XP + Win10/11, two entry points)
One RIOJoy-<ver>.zip now deploys on both OS generations (~75 MB with the
offline XP prerequisites):
- Layout: RIOJoy\app (net48 x64) + RIOJoy\app-xp (net40 x86) +
  RIOJoy\vendor (ViGEmBus; vendor\xp: .NET 4.0 offline installer +
  KB2468871, both signature-verified; RioGamepadXP driver slots in when
  8B lands - build warns/skips until then).
- RIOJoy\install-core.bat: shared OS-detecting install logic (ver ->
  5.1 = XP); pure cmd.exe on the XP path, delegates to install-rio.ps1
  on 10/11. Exports RIOJOY_APPDIR for shortcut creation.
- postinstall.bat (TeslaConsole, unattended): elevates, runs the core,
  then deletes install.bat + README.txt so C:\games stays clean.
- install.bat (standalone computers): same core + Start Menu/desktop
  shortcuts via make-shortcut.vbs (XP-safe); keeps the README.
- README.txt at the zip root explains which entry point to run.
- deploy *.ps1 re-encoded UTF-8-with-BOM: Windows PowerShell read the
  BOM-less files as ANSI, where an em-dash byte parses as a curly quote
  and breaks string parsing (bit install-rio.ps1 in dry-run testing).

Verified: zip layout correct; extracted package dispatch-tested on
Win10 non-elevated (OS detect -> modern route -> admin guard, system
untouched).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 20:53:43 -05:00

43 lines
1.5 KiB
Batchfile

@echo off
rem ===========================================================================
rem RIOJoy cockpit post-install entry point (run by TeslaConsole after the
rem package is extracted into C:\games). Sits beside the 'RIOJoy' payload
rem folder; elevates, runs the shared install core (which picks the XP or
rem modern flavor), then removes the standalone-install files so only
rem launcher-managed files stay at the C:\games root.
rem ===========================================================================
setlocal
title RIOJoy post-install
rem --- elevate if we are not already administrator --------------------------
net session >nul 2>&1
if %errorlevel% neq 0 (
rem "if errorlevel" evaluates at run time (a %var% here would be stale).
ver | findstr /C:"Version 5.1" >nul
if not errorlevel 1 (
echo This installer must run as an Administrator user.
exit /b 1
)
echo Requesting administrator privileges...
powershell -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
exit /b 0
)
cd /d "%~dp0"
call "%~dp0RIOJoy\install-core.bat"
set RC=%errorlevel%
rem --- cleanup: cabinet deploys keep the C:\games root clean ----------------
rem (del tolerates already-missing files, so re-runs stay idempotent)
if exist "%~dp0install.bat" del /q "%~dp0install.bat"
if exist "%~dp0README.txt" del /q "%~dp0README.txt"
echo.
if %RC% neq 0 (
echo postinstall FAILED with exit code %RC%.
) else (
echo postinstall completed.
)
exit /b %RC%