From 3550e208915ab6e4852adb6b1bea6d4e5120c8df Mon Sep 17 00:00:00 2001 From: uduki Date: Thu, 8 Oct 2026 14:12:07 +0900 Subject: [PATCH] =?UTF-8?q?feat(evb):=20=E8=A7=A3=E5=87=8D=E5=AE=8C?= =?UTF-8?q?=E4=BA=86=E3=83=9E=E3=83=BC=E3=82=AB=E3=83=BC=E3=81=AB=E5=9F=BA?= =?UTF-8?q?=E3=81=A5=E3=81=8FEVB=E3=82=B2=E3=83=BC=E3=83=A0=E6=A4=9C?= =?UTF-8?q?=E5=87=BA=E3=81=AE=E7=B6=AD=E6=8C=81=E6=A9=9F=E8=83=BD=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 元exeが .glbak に退避された解凍後でもEVBゲームとして継続認識できるよう IsExtracted 判定を追加 - 解凍完了マーカー(_evb_extracted)の存在を検証し、後続の起動・アイコン解決の破損を防止 --- Engines/Evb/EvbDetectionHelper.cs | 29 +++++++++++++++++++++++++++++ Engines/Evb/EvbDetector.cs | 21 +++++++++++++++++---- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/Engines/Evb/EvbDetectionHelper.cs b/Engines/Evb/EvbDetectionHelper.cs index 8f04c43..39bf941 100644 --- a/Engines/Evb/EvbDetectionHelper.cs +++ b/Engines/Evb/EvbDetectionHelper.cs @@ -92,6 +92,35 @@ namespace GameLauncher.Engines.Evb } } + /// + /// Returns true when the game directory already holds a completed EVB extraction. + /// + /// Once a game is unpacked, the original packed exe is renamed to "*.glbak" and the + /// unpacked files (including the real exe) live inside the game-local "_evb_extracted" + /// folder. At that point can no longer find a + /// top-level "*.exe", so this extra signal is required to keep recognizing the folder + /// as an EVB game (otherwise launch and icon resolution break after unpacking). + /// + /// Only a completed extraction (completion marker present) is accepted, so a normal + /// unpacked game without any EVB artifacts is never misclassified. + /// + public static bool IsExtracted(string gameDirectory) + { + if (string.IsNullOrWhiteSpace(gameDirectory) || !Directory.Exists(gameDirectory)) + { + return false; + } + + try + { + return EvbUnpackService.IsExtractionComplete(gameDirectory, out _); + } + catch + { + return false; + } + } + /// /// Parses the PE section table and checks for the EVB packer's section names. /// diff --git a/Engines/Evb/EvbDetector.cs b/Engines/Evb/EvbDetector.cs index 992bc85..e55d195 100644 --- a/Engines/Evb/EvbDetector.cs +++ b/Engines/Evb/EvbDetector.cs @@ -18,9 +18,16 @@ namespace GameLauncher.Engines.Evb public static class EvbDetector { /// - /// Returns true when the game directory holds an EVB packed executable. - /// A packed project file (*.evb) in the folder is also accepted as a - /// decisive signal, in addition to the PE-signature check. + /// Returns true when the game directory holds an EVB packed executable + /// (or a completed extraction of one). + /// + /// Accepts any of the following decisive signals: + /// 1. A packed project file (*.evb) in the folder. + /// 2. A top-level executable carrying a decisive EVB PE signature. + /// 3. An already-unpacked game (game-local "_evb_extracted" with a completion + /// marker). This is required because unpacking renames the original packed exe + /// to "*.glbak", after which the signature check alone would no longer detect + /// the game and its launch / icon resolution would break. /// public static bool IsEvbGame(string gameDirectory) { @@ -39,7 +46,13 @@ namespace GameLauncher.Engines.Evb } catch { - // Fall through to the executable signature check. + // Fall through to the remaining checks. + } + + // A completed extraction keeps the game recognized even without the packed exe. + if (EvbDetectionHelper.IsExtracted(gameDirectory)) + { + return true; } return EvbDetectionHelper.FindEvbPackedExecutable(gameDirectory) != null;