Add cockpit deployment package + single-instance guard

deploy/ builds a single zip for TeslaConsole: the self-contained tray app and
the signed ViGEmBus installer under a riojoy\ folder, with postinstall.bat at the
root. postinstall elevates and runs riojoy\install-rio.ps1, which installs
ViGEmBus silently (if absent) and registers RIOJoy to start at logon — no cert
trust, test signing, Secure Boot change, or reboot.

Also guard against two instances fighting over the COM port (machine-wide +
per-user autostart both firing): a per-session named mutex makes a second launch
exit immediately. Built zips (dist/) and the bundled installer (deploy/vendor/)
are git-ignored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-06-29 09:29:01 -05:00
co-authored by Claude Opus 4.8
parent 2f434517b7
commit d17fd018eb
6 changed files with 275 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
@echo off
rem ===========================================================================
rem RIOJoy cockpit post-install entry point (run by TeslaConsole).
rem Sits beside the 'riojoy' payload folder; elevates, then runs
rem riojoy\install-rio.ps1.
rem ===========================================================================
setlocal
title RIOJoy post-install
rem --- elevate if we are not already administrator --------------------------
net session >nul 2>&1
if %errorlevel% neq 0 (
echo Requesting administrator privileges...
powershell -NoProfile -Command "Start-Process -FilePath '%~f0' -Verb RunAs"
exit /b 0
)
cd /d "%~dp0"
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0riojoy\install-rio.ps1"
set RC=%errorlevel%
echo.
if %RC% neq 0 (
echo postinstall FAILED with exit code %RC%.
) else (
echo postinstall completed.
)
exit /b %RC%