Rename the package payload folder to RIOJoy (was riojoy) so it extracts to C:\games\RIOJoy, and add a pre-uninstall path the console can run before deleting the folder. - pre-uninstall.bat (inside RIOJoy\): self-elevating entry point that runs uninstall-rio.ps1. - uninstall-rio.ps1: stops the tray app, removes the HKLM Run entry, uninstalls ViGEmBus (-KeepDriver to skip), and clears per-user config for every profile (-KeepConfig to skip). Idempotent and non-fatal. - build-package.ps1 bundles both; README documents the uninstall flow. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
30 lines
884 B
Batchfile
30 lines
884 B
Batchfile
@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%
|