feat(evb): 解凍完了マーカーに基づくEVBゲーム検出の維持機能を追加

- 元exeが .glbak に退避された解凍後でもEVBゲームとして継続認識できるよう IsExtracted 判定を追加
- 解凍完了マーカー(_evb_extracted)の存在を検証し、後続の起動・アイコン解決の破損を防止
This commit is contained in:
armonica committed 2026-10-08 14:12:07 +09:00
1 parent 05e7bdb3c0
commit 3550e20891
2 files changed
+46 -4

No files matched your search

+29
View File
@@ -92,6 +92,35 @@ namespace GameLauncher.Engines.Evb
}
}
/// <summary>
/// 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 <see cref="FindEvbPackedExecutable"/> 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.
/// </summary>
public static bool IsExtracted(string gameDirectory)
{
if (string.IsNullOrWhiteSpace(gameDirectory) || !Directory.Exists(gameDirectory))
{
return false;
}
try
{
return EvbUnpackService.IsExtractionComplete(gameDirectory, out _);
}
catch
{
return false;
}
}
/// <summary>
/// Parses the PE section table and checks for the EVB packer's section names.
/// </summary>
+17 -4
View File
@@ -18,9 +18,16 @@ namespace GameLauncher.Engines.Evb
public static class EvbDetector
{
/// <summary>
/// Returns true when the game directory holds an EVB packed executable.
/// A packed project file (<c>*.evb</c>) 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 (<c>*.evb</c>) 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.
/// </summary>
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;