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>
31 lines
1023 B
Batchfile
31 lines
1023 B
Batchfile
@echo off
|
|
rem ===========================================================================
|
|
rem RIOJoy cockpit pre-uninstall entry point (run by the console before it
|
|
rem deletes the RIOJoy folder). Lives INSIDE the RIOJoy folder beside
|
|
rem uninstall-rio.ps1; elevates, then runs uninstall-rio.ps1 to stop the app,
|
|
rem remove the logon entry, uninstall ViGEmBus, and clear per-user config.
|
|
rem ===========================================================================
|
|
setlocal
|
|
title RIOJoy pre-uninstall
|
|
|
|
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 "%~dp0uninstall-rio.ps1"
|
|
set RC=%errorlevel%
|
|
|
|
echo.
|
|
if %RC% neq 0 (
|
|
echo pre-uninstall FAILED with exit code %RC%.
|
|
) else (
|
|
echo pre-uninstall completed.
|
|
)
|
|
exit /b %RC%
|