pod: fully explicit activation (--profile) + RIOJoy.Tray.Ready signal

No detection anywhere in the pod chain (Cyd: foreground detection is too
slow - the pad appears after the game already enumerated controllers).
--profile <name> activates immediately at startup, never runs the
auto-switch watcher, and on success signals the named manual-reset event
RIOJoy.Tray.Ready (process-lifetime, never stale) so a launcher waits on
the signal instead of counting winmm devices. Legible failures for the
launcher: exit 4 unknown profile, exit 5 activation failed with the reason
on stderr - both verified live against the built exe. Editor close
re-activates the explicit profile. build-pod start scripts now pass
--profile <Name> --exit-with <exe>; docs updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-31 23:01:44 -05:00
co-authored by Claude Fable 5
parent 5befd1d511
commit bdd30678e3
5 changed files with 164 additions and 28 deletions
+14 -4
View File
@@ -164,12 +164,17 @@ try {
Set-Content -Path (Join-Path $staging 'install-riojoy.bat') -Value $installBat -Encoding Ascii
# 5. Start script: the game's launch script calls this before the game.
# Everything explicit - no foreground detection: --profile activates
# immediately so the virtual pad exists before the game enumerates
# controllers, and --exit-with ends RIOJoy when the game exits.
$startBat = @(
'@echo off'
"rem RIOJoy pod companion for $($profileDoc.Name)."
'rem Call from the game''s launch script BEFORE starting the game;'
'rem Call from the game''s launch script BEFORE starting the game:'
'rem the profile activates immediately (no foreground detection), so'
'rem the virtual controller exists before the game enumerates devices.'
'rem RIOJoy exits by itself when the game exits (--exit-with).'
"start `"`" `"%~dp0riojoy\$appDirName\RioJoy.Tray.exe`" --exit-with $GameExe"
"start `"`" `"%~dp0riojoy\$appDirName\RioJoy.Tray.exe`" --profile `"$($profileDoc.Name)`" --exit-with $GameExe"
) -join "`r`n"
Set-Content -Path (Join-Path $staging 'start-riojoy.bat') -Value $startBat -Encoding Ascii
@@ -187,8 +192,13 @@ try {
' Idempotent - safe on every install, reinstall and update; it only'
' adds what is missing and never removes anything.'
' 3. Call start-riojoy.bat from the game''s launch script before the'
' game. RIOJoy activates when the game window comes foreground and'
' exits by itself when the game exits.'
' game. The profile activates immediately and explicitly - no'
' foreground detection - so the virtual controller exists before'
' the game enumerates devices; RIOJoy exits by itself when the'
' game exits. A launcher should wait (with a timeout) on the named'
' event "RIOJoy.Tray.Ready" before starting the game: signaled ='
' pad + ports ready; RIOJoy exit code 4/5 = config/activation'
' failure (reason on stderr); neither = stuck, report.'
' 4. Put NOTHING in the game''s pre-uninstall: drivers stay in place by'
' design (another podized game may use them; idle drivers are'
' harmless).'