From a391292a6a2578efc84a116f3dc37b69564061da Mon Sep 17 00:00:00 2001 From: ginnoir Date: Mon, 10 Aug 2026 21:01:42 -0500 Subject: [PATCH] fix(launcher): handle Game-z.exe builds and ignore extendtext.exe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Soulstones 1 ships `Game-z.exe` rather than `Game.exe`. Find-GameExe preferred `Game.exe` and otherwise fell back to the shallowest non-ignored .exe, which for that build resolved to `extendtext.exe` — a dev tool that was missing from the ignore list — instead of the real launcher. Add extendtext.exe to $ignore and replace the single-name preference with a $launcherNames list (Game.exe, then Game-z.exe) before the shallowest-exe fallback. Co-Authored-By: Claude Opus 5 --- scripts/launch-pc-hack.ps1 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/scripts/launch-pc-hack.ps1 b/scripts/launch-pc-hack.ps1 index 0e81bc6..c64acfb 100644 --- a/scripts/launch-pc-hack.ps1 +++ b/scripts/launch-pc-hack.ps1 @@ -31,17 +31,23 @@ param( $ErrorActionPreference = 'Stop' # dev/editor exes that ship alongside the game but are NOT the launcher -$ignore = @('animmaker.exe', 'rpgxp.exe', 'rgss', 'editor.exe', 'unins', 'setup.exe') +$ignore = @('animmaker.exe', 'rpgxp.exe', 'rgss', 'editor.exe', 'unins', 'setup.exe', 'extendtext.exe') + +# launcher names in preference order — some builds ship mkxp-z as Game-z.exe +# instead of Game.exe (e.g. Soulstones 1). +$launcherNames = @('Game.exe', 'Game-z.exe') function Find-GameExe([string]$root) { - # Prefer Game.exe; fall back to the shallowest non-ignored .exe. + # Prefer a known launcher name; fall back to the shallowest non-ignored .exe. $candidates = Get-ChildItem -LiteralPath $root -Recurse -File -Filter '*.exe' -ErrorAction SilentlyContinue | Where-Object { $n = $_.Name.ToLower(); -not ($ignore | Where-Object { $n -like "*$_*" }) } | Sort-Object { ($_.FullName -split '[\\/]').Count } # shallowest first - $game = $candidates | Where-Object { $_.Name -ieq 'Game.exe' } | Select-Object -First 1 - if (-not $game) { $game = $candidates | Select-Object -First 1 } - return $game + foreach ($name in $launcherNames) { + $game = $candidates | Where-Object { $_.Name -ieq $name } | Select-Object -First 1 + if ($game) { return $game } + } + return $candidates | Select-Object -First 1 } # Resolve the starting directory from whatever Playnite passed.