Compare commits

...
Author SHA1 Message Date
poli0981andClaude Opus 5.5 76e8d58132 feat(detection): the engine version of Ren'Py games, read from the engine's own version file (beta.20 PR-1)
The owner asked (2026-10-12, after beta.19's Unity, Godot and RPG Maker
versions) for the version of Ren'Py games. The renpy rule had no version
extractor.

Ren'Py ships its engine as Python beside the game's launcher, and
renpy/vc_version.py names its release: version = '8.5.0.25111603', beside
branch, nightly, official and version_name. Measured read-only on the
owner's one Ren'Py install, Bound Between Desks (Steam): 109 bytes, the
same number the game's log.txt printed at its last start; the launcher has
no version resource (spike-notes §18).

- Rules 2026.10.3: renpy -> {"type": "renpy_build"}; the schema's enum of
  code-decided extractors gains it. Every entry is read again once.
- Domain: RenPyBuildFacts + RenPyVersion.Decide keep MAJOR.MINOR.PATCH,
  as Ren'Py names its releases (the fourth number is the build), source
  renpy_vc_version; VersionExtractorType.RenPyBuild; the evaluator leaves
  it to the detector, as the other code-decided types.
- Application: IGameFileProbe.ReadRenPyBuildAsync; StaticGameDetector
  makes the one second read for a Ren'Py match.
- Infrastructure: RenPyBuildReader reads the first 4 KiB of
  renpy/vc_version.py beside the executable, its version line only.
- App: the game page says "Ren'Py 8.5.0" and that it was read from the
  engine's version file (en/vi/ja, ja marked review); a Ren'Py row whose
  file names no version says "Not found in the game's files".
- Privacy Policy 2.9: §4's list of the version marks an engine keeps in
  its own files names Ren'Py's (legal-drift-history). The Legal Gate shows
  it once at the next update.
- The accuracy block (ACCURACY, README, DISCLAIMER), LIMITATIONS,
  05_DETECTION §Engine version - Ren'Py, 06_DATA_MODEL, 08_UI, CHANGELOG.
- HANDOFF: owner-only item 15 struck, passed 2026-10-12 (the owner's
  report, and the Agent's log for the removal: one check at 18:04:00 took
  three session-less entries); the rules-reseed trap gains the backup the
  session made of the owner's two rules files.

Through the shipped pipeline (StaticGameDetector over GameFileProbe, read
only): Bound Between Desks renpy 8.5.0 renpy_vc_version in 79 ms; Dialoop,
Plethora of Bullets 2, A Doll's Locket and City of Bones read as before.

Tests: RenPyVersionTests (the measured value; the build dropped; shapes
that are not a version), EngineBuildReadersTests (the measured file beside
the launcher; no file, a version_name only, past the bounded head),
StaticGameDetectorTests (one read for the matched engine),
GameDetailViewModelTests and FormatsTests (the page's words).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 18:27:00 +07:00
35 changed files with 325 additions and 26 deletions

No files matched your search

+9
View File
@@ -28,6 +28,15 @@ numeric core and does not move; the heading is the full version — corrected 20
## [Unreleased]
### Added
- **The engine version of Ren'Py games**, as Unity's, Godot's and RPG Maker's have been shown since beta.19 — on the game's
page with what it was read from, the engine's own `renpy/vc_version.py`: *Ren'Py 8.5.0*. A game whose engine names no
version there reads as not found. Every game is read once more after the update (detection rules `2026.10.3`;
`docs/05_DETECTION.md` §Engine version — Ren'Py).
- **The Privacy Policy (version 2.9)** names that file among the version marks it reads; it is shown once for you to
accept.
## [0.1.0-beta.19] - 2026-10-12
**The nineteenth pre-release: an imported game that is its own runtime and not a helper, Change executable… in the game's
+3 -1
View File
@@ -122,7 +122,9 @@ shown is recorded too, from outside the game. ([Capture](docs/04_CAPTURE.md))
Unity's player library or data file, Godot's data pack, RPG Maker's core script or the runtime library its `Game.ini`
names. A Unity game whose data file is encrypted shows the version without its release letter (`2019.4.40`, not
`2019.4.40f1`); an XP, VX or VX Ace game shows its runtime library's number, which is not the editor's.
**RPG Maker 2000 and 2003 are not recognised.** Other engines show a version only where their files state one.
**RPG Maker 2000 and 2003 are not recognised.**
- Since beta.20 also **Ren'Py**: from the engine's own version file (`renpy/vc_version.py`); a Ren'Py game whose engine
names no version there shows none. Other engines show a version only where their files state one.
([Detection](docs/05_DETECTION.md))
## Sensors
+2 -2
View File
@@ -66,8 +66,8 @@ pages.
> labelled with what it rests on; `N/A` where the executable names none. Since beta.19 also Unity's (from its
> player library or its data file — without the release letter where only the library's number is readable),
> Godot's (from its data pack) and RPG Maker's maker and version (MV and MZ from their core script; XP, VX and VX
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Other
> engines show what their own files state.
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Since
> beta.20 also Ren'Py's (from its engine's version file). Other engines show what their own files state.
> - **The game's own memory (since beta.12):** its dedicated and shared GPU memory and its private
> working set — the numbers Task Manager's Details tab shows — with its working set and commit, read
> once a second from Windows' own counters, from outside the game, in every session: a game
+20
View File
@@ -287,6 +287,26 @@ read by the VX Ace rule's reader unmeasured. A Unity build older than 2019 keeps
`UnityPlayer.dll`): its data file's header is the only witness. Rules `2026.10.2` change the detection key, so every
library entry is read again once; a Unity row keeps the old raw string only if none of its witnesses can be read now.
### Engine version — Ren'Py (beta.20, 2026-10-12, rules 2026.10.3)
The owner asked for the version of Ren'Py games once beta.19's were on screen. The `renpy` rule had no version extractor
(`version: null`). Ren'Py ships its engine as Python beside the game's launcher, and `renpy/vc_version.py` names its
release — `version = '8.5.0.25111603'`, beside `branch`, `nightly`, `official` and `version_name`. Measured 2026-10-12 on
the owner's one Ren'Py install, Bound Between Desks (Steam): 109 bytes, and the game's own `log.txt` printed
`Ren'Py 8.5.0.25111603` at its last start; the launcher carries no version resource (`spike-notes` §18).
**What is read and how it is decided.** `renpy_build` (`RenPyBuildReader`): the first 4 KiB of `renpy/vc_version.py`
beside the row's executable, its `version` line only (`version_name` is not it). `RenPyVersion.Decide` keeps
MAJOR.MINOR.PATCH — Ren'Py names its releases by those three; the fourth is the build — and records `renpy_vc_version`.
The page says *Ren'Py 8.5.0* and that it was read from the engine's version file; a Ren'Py row whose file names no
version says *Not found in the game's files*. Through the shipped pipeline (`StaticGameDetector` over `GameFileProbe`)
Bound Between Desks read `8.5.0` in 79 ms, and the Unity, Godot and RPG Maker installs read as before. The Privacy
Policy names the file since 2.9 (§4). Rules `2026.10.3` change the detection key, so every library entry is read again
once.
**What it is not.** Nothing else is guessed from: a Ren'Py game whose `vc_version.py` names no version, or that ships its
engine compiled only, reads as not found. One Ren'Py install was measured.
### Platform signatures & metadata
| Platform | Signals | Metadata |
+2 -1
View File
@@ -49,7 +49,8 @@ CREATE TABLE games (
-- (schema 0015, ALTERed last) engine_version_source TEXT: where engine_version came from — a
-- Domain.Detection.EngineVersionSource id (unreal_branch_file | unreal_branch | unreal_file_version; since beta.19
-- unity_player | unity_data | unity_player_file | godot_pck | godot_pck_embedded | godot_exe | rpgmaker_mz_core |
-- rpgmaker_mv_core | rgss1_library | rgss2_library | rgss3_library — the RPG Maker ids also name the maker; or the
-- rpgmaker_mv_core | rgss1_library | rgss2_library | rgss3_library — the RPG Maker ids also name the maker; since
-- beta.20 renpy_vc_version; or the
-- rule's extractor type); NULL for a version the user typed. Written with the version only (05_DETECTION §Engine version)
publisher TEXT, game_version TEXT,
cover_path TEXT, notes TEXT,
+3 -2
View File
@@ -388,8 +388,9 @@ All screens are `Page`s registered with the navigation page provider and navigat
> is the newest session that read a driver profile, in the same words; no row where none did. Tests:
> `NvidiaOverridesTests`, `GameDetailViewModelTests.TheDetailsCardNamesTheNvidiaAppsOverridesFromTheNewestSessionThatReadThem`.
> **The *Engine* row carries the version, and an *Engine version* row says what it was read from** (beta.10 for Unreal;
> beta.19 for Unity, Godot and RPG Maker — `05_DETECTION` §Engine version): the player library, the data file's header, a
> data pack, a core script or the RGSS library `Game.ini` names, and *Not found in the game's files* once the Agent has
> beta.19 for Unity, Godot and RPG Maker; beta.20 for Ren'Py — `05_DETECTION` §Engine version): the player library, the
> data file's header, a data pack, a core script, the RGSS library `Game.ini` names or Ren'Py's `renpy/vc_version.py`, and
> *Not found in the game's files* once the Agent has
> read such a title and found none. RPG Maker's witness names the maker on the page, the subtitle and the library card
> (*RPG Maker MZ 1.10.0*, *RPG Maker VX Ace (RGSS 3.0.1)*; `Formats.Engine(id, source)`). Tests:
> `GameDetailViewModelTests.TheDetailsCardSaysWhatAUnityGodotOrRpgMakerVersionWasReadFrom`,
+14 -3
View File
@@ -2184,9 +2184,16 @@ then the release.*
first to be held before starting the second, and bound every wait).
- **A test run reseeds `%LOCALAPPDATA%\FrameLedger\rules`** with rules `2026.10.2`, whose extractor types the installed
beta.18 cannot parse: its detection sweep says "rules unusable" until it restarts or beta.19 is installed (beta.10's
trap, met again; the guard is unaffected).
trap, met again; the guard is unaffected). For beta.20 PR-1 (rules `2026.10.3`, which the installed beta.19 cannot
parse) the session copied the owner's `detection-rules.json` and `.seeded` aside before testing and back after,
byte for byte, so the owner's running Agent kept its own.
**Owner-only, added to the list below:** item 15.
**Owner-only, added to the list below:** item 15 — **passed 2026-10-12**.
**After the release (owner, 2026-10-12):** "tiếp tục với 1 pr kèm với detect version game dùng ren'py" — beta.20 PR-1 reads
a Ren'Py game's engine version from `renpy/vc_version.py` (rules `2026.10.3`, Privacy Policy 2.9 — the Legal Gate shows it
once at the next update; `05_DETECTION` §Engine version — Ren'Py) and strikes item 15. Merged for the next pre-release;
no release was asked for.
## Owner-only — no PR can close these
@@ -2290,7 +2297,11 @@ then the release.*
without `-dirty`. (c) **Disable all hooking:** turning it on says a game being measured stops within 30 seconds; with
it on, a hooked game's notice reads "All hooking is switched off in Settings, so nothing was measured." (d) The `ja`
strings marked `review`, `Safety_Unhooked_Unnamed_Format` among them.
15. **beta.19 on real hardware.** (a) **A Doll's Locket - Remake:** its page ▸ *Change executable…* opens in `Dolls
15. ~~**beta.19 on real hardware.**~~ **Passed 2026-10-12** — the owner ran it and reported (a), (c), (d)'s unplugged
drive, (e) and (f) OK ("Các mục đã test: 1, 2. 5, 6, 4, ok"); (b) and (d)'s removal were read from the logs: Refresh
named the existing entry instead of offering a twin, and one check at 18:04:00 removed Deadly Heart Gambit, Vibe Train
Demo and 衔蝶 (the App's restart at 17:47 had started the ten minutes again), the library then reading *Games · 46*.
*(The item as written:)* (a) **A Doll's Locket - Remake:** its page ▸ *Change executable…* opens in `Dolls
Locket\`; pick `css\Game.exe`. Its launcher asks for administrator, so the runtime is measured only with *Run the agent
as administrator* on — otherwise the session says why nothing was measured. (b) **Refresh** offers no second A Doll's
Locket. (c) **Engine versions:** a Unity game's page (*Unity 2022.3.62f2* on Umamusume, *Unity 2019.4.40* on GIRLS'
+6
View File
@@ -63,6 +63,12 @@ are kept because they record what each version changed and why (owner decision D
>
> Version 2.5 (2026-09-27, 0.1.0-beta.10) adds how a tracked game's window is shown — read from Windows — and the engine build name read from an Unreal Engine game's executable. It is also the first version to say two things the software already did: it reads the **content** of a library game's executable (markers in its first 8 MB and its import table, since the detection of engines and features; and, when a session starts, the graphics-library markers in the whole file), and it reads the processor load and the memory in use (since 0.1.0-beta.3). Nothing here leaves your device, as before.
### What version 2.9 of the Privacy Policy changed (0.1.0-beta.20)
§4's list of the version marks an engine keeps in its own files gains one: the version file of a Ren'Py game's engine
(`renpy/vc_version.py`), read to show a Ren'Py game's engine version (beta.20 PR-1, owner request 2026-10-12) — its first
4 KiB, for the `version` line only. Nothing here leaves your device, as before.
### What version 2.8 of the Privacy Policy changed (0.1.0-beta.19)
§4 names the version marks an engine keeps in its own files, read to show a Unity, Godot or RPG Maker game's engine
+19
View File
@@ -2664,3 +2664,22 @@ Godot, RPG Maker.
player is the executable, with no `UnityPlayer.dll`), a Godot 3 export, and a Godot pack appended to the executable
(both installs ship the pack beside it; the trailer the reader follows is Godot's documented layout, tested on
synthetic files only).
## 18 · The Ren'Py version in an installed game *(2026-10-12, beta.20)*
The owner's one Ren'Py install, read-only: Bound Between Desks (Steam) — `BoundBetweenDesks.exe` (386,048 bytes, no version
resource), `BoundBetweenDesks.py`, `game\`, `lib\py3-windows-x86_64\` (Python 3.12: `libpython3.12.dll`,
`librenpython.dll`, `pythonw.exe`) and `renpy\` with the engine's `.py` sources beside `__pycache__\*.cpython-312.pyc`.
- `renpy\vc_version.py` (109 bytes, LF line ends): `branch = 'master'`, `nightly = False`, `official = True`,
`version = '8.5.0.25111603'`, `version_name = 'In Good Health'`.
- `renpy\__init__.py` imports those names from `vc_version` (else from `renpy.versions.get_version()`) and builds
`version_tuple` from `version.split(".")`; `renpy.version` is `"Ren'Py " + version_only`.
- The game's own `log.txt` (written at its last start, 2026-09-16) begins `Ren'Py 8.5.0.25111603`: the same number.
Then through the shipped pipeline (`StaticGameDetector` over `GameFileProbe`, rules `2026.10.3`): `renpy 8.5.0
renpy_vc_version` in 79 ms; Dialoop (`unity 6000.3.3f1`), Plethora of Bullets 2 (`godot 4.2.2`), A Doll's Locket - Remake
(`rpgmaker_mv 1.10.0`) and City of Bones (`rpgmaker_rgss 3.0.1`) read as in §17.
- **Not measured:** an older Ren'Py (no other install), whose `vc_version.py` may name no `version` — it then reads as
not found; a build that ships the engine compiled only (none seen).
+2 -2
View File
@@ -66,8 +66,8 @@
> labelled with what it rests on; `N/A` where the executable names none. Since beta.19 also Unity's (from its
> player library or its data file — without the release letter where only the library's number is readable),
> Godot's (from its data pack) and RPG Maker's maker and version (MV and MZ from their core script; XP, VX and VX
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Other
> engines show what their own files state.
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Since
> beta.20 also Ren'Py's (from its engine's version file). Other engines show what their own files state.
> - **The game's own memory (since beta.12):** its dedicated and shared GPU memory and its private
> working set — the numbers Task Manager's Details tab shows — with its working set and commit, read
> once a second from Windows' own counters, from outside the game, in every session: a game
+2 -2
View File
@@ -168,8 +168,8 @@ Frame timing is derived from high-resolution timestamps taken at the moment the
> labelled with what it rests on; `N/A` where the executable names none. Since beta.19 also Unity's (from its
> player library or its data file — without the release letter where only the library's number is readable),
> Godot's (from its data pack) and RPG Maker's maker and version (MV and MZ from their core script; XP, VX and VX
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Other
> engines show what their own files state.
> Ace by their runtime library's version, which is not the editor's). RPG Maker 2000/2003 is not detected. Since
> beta.20 also Ren'Py's (from its engine's version file). Other engines show what their own files state.
> - **The game's own memory (since beta.12):** its dedicated and shared GPU memory and its private
> working set — the numbers Task Manager's Details tab shows — with its working set and commit, read
> once a second from Windows' own counters, from outside the game, in every session: a game
+2 -2
View File
@@ -1,6 +1,6 @@
# FrameLedger — Privacy Policy
**Version:** 2.8 · **Effective:** {{RELEASE_DATE}}
**Version:** 2.9 · **Effective:** {{RELEASE_DATE}}
**Short version: everything stays on your PC. FrameLedger has no accounts, no telemetry, no analytics, and never uploads your data anywhere.**
@@ -39,7 +39,7 @@ An exported session (CSV or JSON) and a bug report can contain your games' names
## 4. What the app can technically observe
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, and the library Game.ini names), and the store files that name it (Steam's and GOG's, on your disk) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
It does **not** read game memory outside those API parameters, and does not read game saves, chat, input content, network traffic, or anything unrelated to performance measurement. It records only for programs you added to your library and did not switch recording off for — a program whose recording is off is not watched at all — and injects only into games you individually enabled.
+2 -2
View File
@@ -42,7 +42,7 @@
"level, which made it a check that could not fire."
],
"schemaVersion": 2,
"rulesVersion": "2026.10.2",
"rulesVersion": "2026.10.3",
"engines": [
{
@@ -124,7 +124,7 @@
{ "type": "dir_exists", "value": "renpy" },
{ "type": "sibling_glob", "value": "*.rpa" }
] },
"version": null
"version": { "type": "renpy_build" }
},
{
"id": "cryengine",
+2 -2
View File
@@ -198,12 +198,12 @@
}
},
{
"$comment": "beta.10: Unreal Engine's build facts (the shipping executable's numeric file version and the engine's branch name inside it), decided in code (Domain.Detection.UnrealVersion) rather than by a pattern - which is why it takes no parameter. beta.19 adds Unity's (the player library's version resource, the data file's header), Godot's (a data pack's header, the executable's version resource) and RPG Maker's (MV/MZ's core-script header, the RGSS library Game.ini names), decided by UnityVersion, GodotVersion and RpgMakerVersion.",
"$comment": "beta.10: Unreal Engine's build facts (the shipping executable's numeric file version and the engine's branch name inside it), decided in code (Domain.Detection.UnrealVersion) rather than by a pattern - which is why it takes no parameter. beta.19 adds Unity's (the player library's version resource, the data file's header), Godot's (a data pack's header, the executable's version resource) and RPG Maker's (MV/MZ's core-script header, the RGSS library Game.ini names), decided by UnityVersion, GodotVersion and RpgMakerVersion. beta.20 adds Ren'Py's (the version line of the engine's renpy/vc_version.py), decided by RenPyVersion.",
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {
"type": { "enum": ["unreal_build", "unity_build", "godot_build", "rpgmaker_build"] }
"type": { "enum": ["unreal_build", "unity_build", "godot_build", "rpgmaker_build", "renpy_build"] }
}
}
]
+3
View File
@@ -453,6 +453,7 @@ public static class Strings
nameof(GameDetail_EngineVersion_GodotPackEmbedded),
nameof(GameDetail_EngineVersion_NotFound),
nameof(GameDetail_EngineVersion_NotFoundInFiles),
nameof(GameDetail_EngineVersion_RenPyVcVersion),
nameof(GameDetail_EngineVersion_Rgss),
nameof(GameDetail_EngineVersion_UnityData),
nameof(GameDetail_EngineVersion_UnityPlayer),
@@ -1924,6 +1925,8 @@ public static class Strings
public static string GameDetail_EngineVersion_NotFoundInFiles => ResourceManager.GetString(nameof(GameDetail_EngineVersion_NotFoundInFiles), Culture) ?? nameof(GameDetail_EngineVersion_NotFoundInFiles);
public static string GameDetail_EngineVersion_RenPyVcVersion => ResourceManager.GetString(nameof(GameDetail_EngineVersion_RenPyVcVersion), Culture) ?? nameof(GameDetail_EngineVersion_RenPyVcVersion);
public static string GameDetail_EngineVersion_Rgss => ResourceManager.GetString(nameof(GameDetail_EngineVersion_Rgss), Culture) ?? nameof(GameDetail_EngineVersion_Rgss);
public static string GameDetail_EngineVersion_UnityData => ResourceManager.GetString(nameof(GameDetail_EngineVersion_UnityData), Culture) ?? nameof(GameDetail_EngineVersion_UnityData);
+4
View File
@@ -2981,6 +2981,10 @@
<value>ゲームの Game.ini が指定する RPG Maker のランタイムライブラリ(RGSS)から。この番号はエディターではなくライブラリのものです。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_RenPyVcVersion" xml:space="preserve">
<value>ゲームの Ren'Py エンジンのバージョンファイル(renpy/vc_version.py)から。</value>
<comment>review</comment>
</data>
<data name="GameDetail_EngineVersion_NotFoundInFiles" xml:space="preserve">
<value>ゲームのファイルには見つかりません。</value>
<comment>review</comment>
+3
View File
@@ -2246,6 +2246,9 @@ The documents below are the full terms; this summary does not replace them.</val
<data name="GameDetail_EngineVersion_Rgss" xml:space="preserve">
<value>From the RPG Maker runtime library (RGSS) that the game's Game.ini names. The number is the library's, not the editor's.</value>
</data>
<data name="GameDetail_EngineVersion_RenPyVcVersion" xml:space="preserve">
<value>From the version file of the game's Ren'Py engine (renpy/vc_version.py).</value>
</data>
<data name="GameDetail_EngineVersion_NotFoundInFiles" xml:space="preserve">
<value>Not found in the game's files.</value>
</data>
+3
View File
@@ -2241,6 +2241,9 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
<data name="GameDetail_EngineVersion_Rgss" xml:space="preserve">
<value>Lấy từ thư viện runtime RPG Maker (RGSS) mà file Game.ini của game chỉ định. Đây là số phiên bản của thư viện, không phải của trình biên tập.</value>
</data>
<data name="GameDetail_EngineVersion_RenPyVcVersion" xml:space="preserve">
<value>Lấy từ file phiên bản của engine Ren'Py trong game (renpy/vc_version.py).</value>
</data>
<data name="GameDetail_EngineVersion_NotFoundInFiles" xml:space="preserve">
<value>Không tìm thấy trong các file của game.</value>
</data>
@@ -1200,9 +1200,10 @@ public sealed partial class GameDetailViewModel : ObservableObject
EngineVersionSource.RpgMakerMzCore => string.Format(CultureInfo.CurrentCulture, Strings.GameDetail_EngineVersion_CoreScript_Format, "js/rmmz_core.js"),
EngineVersionSource.RpgMakerMvCore => string.Format(CultureInfo.CurrentCulture, Strings.GameDetail_EngineVersion_CoreScript_Format, "rpg_core.js"),
EngineVersionSource.Rgss1Library or EngineVersionSource.Rgss2Library or EngineVersionSource.Rgss3Library => Strings.GameDetail_EngineVersion_Rgss,
EngineVersionSource.RenPyVcVersion => Strings.GameDetail_EngineVersion_RenPyVcVersion,
null when string.Equals(row.Engine, "unreal", StringComparison.Ordinal) && row.EngineVersion is null && row.ExeMachine is not null
=> Strings.GameDetail_EngineVersion_NotFound,
null when row.Engine is "unity" or "godot" or "rpgmaker_mv" or "rpgmaker_rgss" && row.EngineVersion is null && row.ExeMachine is not null
null when row.Engine is "unity" or "godot" or "rpgmaker_mv" or "rpgmaker_rgss" or "renpy" && row.EngineVersion is null && row.ExeMachine is not null
=> Strings.GameDetail_EngineVersion_NotFoundInFiles,
_ => null,
};
@@ -43,4 +43,10 @@ public interface IGameFileProbe
/// <see cref="VersionExtractorType.RpgMakerBuild"/>. Null when neither is found.
/// </summary>
ValueTask<RpgMakerBuildFacts?> ReadRpgMakerBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default);
/// <summary>
/// Ren'Py's build facts (beta.20) — the <c>version</c> line of the engine's <c>renpy/vc_version.py</c> beside the
/// launcher — for <see cref="VersionExtractorType.RenPyBuild"/>. Null when the file names none or could not be read.
/// </summary>
ValueTask<RenPyBuildFacts?> ReadRenPyBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default);
}
@@ -60,7 +60,7 @@ public sealed class StaticGameDetector(IDetectionRulesSource rulesSource, IGameF
/// <summary>
/// The matched engine's version and its witness. The rules' own extractors answer from the snapshot; an engine whose
/// version is decided in code — Unreal since beta.10, Unity, Godot and RPG Maker since beta.19 — gets one second read,
/// version is decided in code — Unreal since beta.10, Unity, Godot and RPG Maker since beta.19, Ren'Py since beta.20 — gets one second read,
/// made here for the one engine that matched rather than by the probe for every game.
/// </summary>
private async ValueTask<EngineVersionReading> VersionAsync(EngineMatch engine, GameFileSnapshot snapshot, CancellationToken ct)
@@ -80,6 +80,8 @@ public sealed class StaticGameDetector(IDetectionRulesSource rulesSource, IGameF
return await _probe.ReadGodotBuildAsync(snapshot, ct).ConfigureAwait(false) is { } godot ? GodotVersion.Decide(godot) : EngineVersionReading.None;
case VersionExtractorType.RpgMakerBuild:
return await _probe.ReadRpgMakerBuildAsync(snapshot, ct).ConfigureAwait(false) is { } maker ? RpgMakerVersion.Decide(maker) : EngineVersionReading.None;
case VersionExtractorType.RenPyBuild:
return await _probe.ReadRenPyBuildAsync(snapshot, ct).ConfigureAwait(false) is { } renpy ? RenPyVersion.Decide(renpy) : EngineVersionReading.None;
default:
return engine.Version is null ? EngineVersionReading.None : new EngineVersionReading(engine.Version, EngineVersionSource.Of(extractor.Type));
}
@@ -51,6 +51,9 @@ public static class EngineVersionSource
/// <summary>RPG Maker VX Ace: the RGSS3 library.</summary>
public const string Rgss3Library = "rgss3_library";
/// <summary>Ren'Py (beta.20): the <c>version</c> line of the engine's <c>renpy/vc_version.py</c>, MAJOR.MINOR.PATCH.</summary>
public const string RenPyVcVersion = "renpy_vc_version";
/// <summary>The rule's own extractor, named as the rules file names it (<c>pe_file_version</c>, <c>strings_regex</c>, …).</summary>
public static string Of(VersionExtractorType type) => type switch
{
@@ -62,6 +65,7 @@ public static class EngineVersionSource
VersionExtractorType.UnityBuild => "unity_build",
VersionExtractorType.GodotBuild => "godot_build",
VersionExtractorType.RpgMakerBuild => "rpgmaker_build",
VersionExtractorType.RenPyBuild => "renpy_build",
_ => throw new ArgumentOutOfRangeException(nameof(type), type, "not a version extractor"),
};
}
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Domain.Detection;
/// <summary>
/// What a Ren'Py title's own files say about the engine it was built with (beta.20), read from the files on disk.
/// </summary>
/// <remarks>
/// Ren'Py ships its engine as Python beside the game's launcher, and the engine's <c>renpy/vc_version.py</c> names its
/// release: <c>version = '8.5.0.25111603'</c>, with <c>version_name</c>, <c>branch</c>, <c>official</c> and <c>nightly</c>
/// beside it. Measured 2026-10-12 on the owner's one Ren'Py install, Bound Between Desks (Steam): <c>8.5.0.25111603</c>,
/// the same number the game's own <c>log.txt</c> printed at its last start (<c>Ren'Py 8.5.0.25111603</c>). Its launcher
/// executable carries no version resource.
/// </remarks>
public sealed record RenPyBuildFacts
{
/// <summary>The <c>version</c> string of <c>renpy/vc_version.py</c> (<c>8.5.0.25111603</c>), or null when it names none.</summary>
public string? VcVersion { get; init; }
}
@@ -0,0 +1,35 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Globalization;
using System.Text.RegularExpressions;
namespace FrameLedger.Domain.Detection;
/// <summary>The Ren'Py version a title was built with (beta.20), decided from <see cref="RenPyBuildFacts"/> — or nothing.</summary>
/// <remarks>
/// One witness: the engine's own <c>renpy/vc_version.py</c>. Its <c>version</c> carries a fourth number, the build
/// (<c>8.5.0.25111603</c>); a Ren'Py release is named by the first three (Ren'Py 8.5.0), so those are kept. A title whose
/// engine names no version there reads as none — nothing else is guessed from.
/// </remarks>
public static partial class RenPyVersion
{
/// <summary>The version these facts establish, and the witness it rests on.</summary>
public static EngineVersionReading Decide(RenPyBuildFacts facts)
{
ArgumentNullException.ThrowIfNull(facts);
return facts.VcVersion is { } text && Shape().Match(text.Trim()) is { Success: true } m
&& Parse(m.Groups["major"].Value) is >= 1 and <= 99 and int major
&& Parse(m.Groups["minor"].Value) is >= 0 and int minor
&& Parse(m.Groups["patch"].Value) is >= 0 and int patch
? new EngineVersionReading(string.Create(CultureInfo.InvariantCulture, $"{major}.{minor}.{patch}"), EngineVersionSource.RenPyVcVersion)
: EngineVersionReading.None;
}
private static int Parse(string digits) =>
int.TryParse(digits, NumberStyles.None, CultureInfo.InvariantCulture, out int value) ? value : -1;
[GeneratedRegex(@"^(?<major>\d{1,2})\.(?<minor>\d{1,3})\.(?<patch>\d{1,3})(?:\.\d{1,12})?$", RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
private static partial Regex Shape();
}
@@ -235,7 +235,7 @@ public sealed class RuleEvaluator
// that matched (beta.10; Unity, Godot and RPG Maker since beta.19) — reads the probe must not make for every
// game in the library.
VersionExtractorType.UnrealBuild or VersionExtractorType.UnityBuild or VersionExtractorType.GodotBuild
or VersionExtractorType.RpgMakerBuild => null,
or VersionExtractorType.RpgMakerBuild or VersionExtractorType.RenPyBuild => null,
_ => null,
};
}
@@ -40,4 +40,7 @@ public enum VersionExtractorType
/// (<see cref="RpgMakerVersion.Decide"/>).
/// </summary>
RpgMakerBuild,
/// <summary>Ren'Py's (beta.20): the <c>version</c> line of the engine's <c>renpy/vc_version.py</c> (<see cref="RenPyVersion.Decide"/>).</summary>
RenPyBuild,
}
@@ -228,6 +228,7 @@ public sealed class DetectionRulesFile : IDetectionRulesSource
"unity_build" => VersionExtractorType.UnityBuild,
"godot_build" => VersionExtractorType.GodotBuild,
"rpgmaker_build" => VersionExtractorType.RpgMakerBuild,
"renpy_build" => VersionExtractorType.RenPyBuild,
_ => throw new InvalidOperationException($"'{owner}' has unknown version extractor '{d.Type}'"),
},
Value = d.Value,
@@ -160,6 +160,15 @@ public sealed class GameFileProbe : IGameFileProbe
return ValueTask.FromResult(RpgMakerBuildReader.Read(Native(snapshot.ExePath), library));
}
/// <inheritdoc />
/// <remarks>The engine's <c>renpy/vc_version.py</c> beside the launcher, where Ren'Py keeps it.</remarks>
public ValueTask<RenPyBuildFacts?> ReadRenPyBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default)
{
ArgumentNullException.ThrowIfNull(snapshot);
ct.ThrowIfCancellationRequested();
return ValueTask.FromResult(RenPyBuildReader.Read(Native(snapshot.ExePath)));
}
private static string Native(string path) => path.Replace('/', Path.DirectorySeparatorChar);
/// <summary>The full path of the shallowest file the walk listed whose name <paramref name="named"/> accepts, or null.</summary>
@@ -0,0 +1,49 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Text;
using System.Text.RegularExpressions;
using FrameLedger.Domain.Detection;
namespace FrameLedger.Infrastructure.Detection;
/// <summary>
/// Ren'Py's build facts from the files on disk (beta.20, <c>05_DETECTION</c> §Engine version — Ren'Py): the <c>version</c>
/// line of the engine's <c>renpy/vc_version.py</c>, which Ren'Py keeps beside the game's launcher — read from its first
/// <see cref="VersionFileBytes"/> bytes. Nothing else of the engine's files is read.
/// </summary>
public static partial class RenPyBuildReader
{
/// <summary>How much of <c>vc_version.py</c> is read: the measured file is 109 bytes.</summary>
public const int VersionFileBytes = 4096;
/// <summary>The facts for the launcher <paramref name="exePath"/>, or null when its engine's version file names none.</summary>
public static RenPyBuildFacts? Read(string exePath)
{
ArgumentException.ThrowIfNullOrWhiteSpace(exePath);
string? folder = Path.GetDirectoryName(exePath);
return folder is null ? null : ReadVersionFile(Path.Combine(folder, "renpy", "vc_version.py"));
}
/// <summary>The <c>version</c> a <c>vc_version.py</c> names, or null. Public for the tests.</summary>
public static RenPyBuildFacts? ReadVersionFile(string path)
{
ArgumentException.ThrowIfNullOrWhiteSpace(path);
try
{
using var file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete, bufferSize: 1);
byte[] head = new byte[VersionFileBytes];
int read = file.ReadAtLeast(head, head.Length, throwOnEndOfStream: false);
Match m = VersionLine().Match(Encoding.UTF8.GetString(head, 0, read));
return m.Success ? new RenPyBuildFacts { VcVersion = m.Groups["version"].Value } : null;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
return null;
}
}
/// <summary><c>version = '8.5.0.25111603'</c> at the start of a line — never <c>version_name</c>, whose name goes on.</summary>
[GeneratedRegex(@"^version\s*=\s*['""](?<version>[^'""\r\n]{1,64})['""]", RegexOptions.ExplicitCapture | RegexOptions.Multiline | RegexOptions.CultureInvariant, matchTimeoutMilliseconds: 250)]
private static partial Regex VersionLine();
}
@@ -190,6 +190,7 @@ public sealed class FormatsTests
Formats.EngineWithVersion("rpgmaker_rgss", "3.0.1", EngineVersionSource.Rgss3Library).Should().Be("RPG Maker VX Ace (RGSS 3.0.1)");
Formats.EngineWithVersion("unity", "2022.3.39f1", EngineVersionSource.UnityPlayer).Should().Be("Unity 2022.3.39f1");
Formats.EngineWithVersion("godot", "4.4.1", EngineVersionSource.GodotPack).Should().Be("Godot 4.4.1");
Formats.EngineWithVersion("renpy", "8.5.0", EngineVersionSource.RenPyVcVersion).Should().Be("Ren'Py 8.5.0");
Formats.EngineWithVersion("unreal", "5.4.4", EngineVersionSource.UnrealFileVersion).Should().Be("Unreal Engine 5.4.4");
Formats.EngineWithVersion("unity", "6000.0", null).Should().Be("Unity 6000.0", "a version the user typed has no witness");
Formats.EngineWithVersion("godot", null, null).Should().Be("Godot");
@@ -630,7 +630,7 @@ public sealed class GameDetailViewModelTests
/// <summary>
/// beta.19: a Unity, Godot or RPG Maker version says what it was read from, RPG Maker's witness names the maker in the
/// header, and such a title whose files named no version says so once the sweep has read it.
/// header, and such a title whose files named no version says so once the sweep has read it — Ren'Py's too since beta.20.
/// </summary>
[Fact]
public async Task TheDetailsCardSaysWhatAUnityGodotOrRpgMakerVersionWasReadFrom()
@@ -650,6 +650,8 @@ public sealed class GameDetailViewModelTests
("xiandie", "godot", "4.4.1", EngineVersionSource.GodotPack, "Godot 4.4.1", Strings.GameDetail_EngineVersion_GodotPack),
("GF2", "unity", "2019.4.40", EngineVersionSource.UnityPlayerFile, "Unity 2019.4.40", Strings.GameDetail_EngineVersion_UnityPlayerFile),
("Unread", "unity", null, null, "Unity", Strings.GameDetail_EngineVersion_NotFoundInFiles),
("Bound Between Desks", "renpy", "8.5.0", EngineVersionSource.RenPyVcVersion, "Ren'Py 8.5.0", "From the version file of the game's Ren'Py engine (renpy/vc_version.py)."),
("Older Novel", "renpy", null, null, "Ren'Py", Strings.GameDetail_EngineVersion_NotFoundInFiles),
];
foreach ((string name, string engine, string? version, string? source, string subtitle, string witness) in cases)
{
@@ -87,6 +87,9 @@ public sealed class DetectionSweepTests
public ValueTask<RpgMakerBuildFacts?> ReadRpgMakerBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default) =>
ValueTask.FromResult<RpgMakerBuildFacts?>(null);
public ValueTask<RenPyBuildFacts?> ReadRenPyBuildAsync(GameFileSnapshot snapshot, CancellationToken ct = default) =>
ValueTask.FromResult<RenPyBuildFacts?>(null);
}
private sealed class FakeIdentity : IExecutableIdentitySource
@@ -48,6 +48,8 @@ public sealed class StaticGameDetectorTests
public RpgMakerBuildFacts? RpgMaker { get; init; }
public RenPyBuildFacts? RenPy { get; init; }
/// <summary>Which of the beta.19 second reads was made, in order.</summary>
public List<string> BuildReads { get; } = [];
@@ -68,6 +70,12 @@ public sealed class StaticGameDetectorTests
BuildReads.Add("rpgmaker");
return ValueTask.FromResult(RpgMaker);
}
public ValueTask<RenPyBuildFacts?> ReadRenPyBuildAsync(GameFileSnapshot s, CancellationToken ct = default)
{
BuildReads.Add("renpy");
return ValueTask.FromResult(RenPy);
}
}
private static SignalGroup Any(params string[] globs) => new()
@@ -283,24 +291,28 @@ public sealed class StaticGameDetectorTests
new EngineRule { Id = "unity", Name = "Unity", Signals = Any("UnityPlayer.dll"), Version = new VersionExtractor { Type = VersionExtractorType.UnityBuild } },
new EngineRule { Id = "rpgmaker_mv", Name = "RPG Maker MV/MZ", Signals = Any("nw.dll"), Version = new VersionExtractor { Type = VersionExtractorType.RpgMakerBuild } },
new EngineRule { Id = "godot", Name = "Godot", Signals = Any("*.pck"), Version = new VersionExtractor { Type = VersionExtractorType.GodotBuild } },
new EngineRule { Id = "renpy", Name = "Ren'Py", Signals = Any("*.rpa"), Version = new VersionExtractor { Type = VersionExtractorType.RenPyBuild } },
],
};
/// <summary>
/// beta.19: Unity, Godot and RPG Maker decide their versions in code as Unreal does — one second read, for the engine that
/// matched only, and the decider's witness reported (the owner's Dialoop, 衔蝶 and A Doll's Locket - Remake as measured).
/// matched only, and the decider's witness reported (the owner's Dialoop, 衔蝶 and A Doll's Locket - Remake as measured);
/// Ren'Py since beta.20 (Bound Between Desks).
/// </summary>
[Theory]
[InlineData("UnityPlayer.dll", "unity", "6000.3.3f1", EngineVersionSource.UnityPlayer)]
[InlineData("xiandie.pck", "godot", "4.4.1", EngineVersionSource.GodotPack)]
[InlineData("css/nw.dll", "rpgmaker", "1.10.0", EngineVersionSource.RpgMakerMzCore)]
public async Task UnityGodotAndRpgMakerReadTheirBuildFactsOnceForTheEngineThatMatched(string marker, string read, string version, string source)
[InlineData("game/archive.rpa", "renpy", "8.5.0", EngineVersionSource.RenPyVcVersion)]
public async Task EnginesDecidedInCodeReadTheirBuildFactsOnceForTheEngineThatMatched(string marker, string read, string version, string source)
{
var probe = new ScriptedProbe(Snapshot(marker))
{
Unity = new UnityBuildFacts { PlayerProductVersion = "6000.3.3f1 (ef04196de0d6)", PlayerFileVersion = [6000, 3, 3, 15664153] },
Godot = new GodotBuildFacts { PackVersion = [4, 4, 1], ExeProductName = "xiandie", ExeProductVersion = "0.1.0.3" },
RpgMaker = new RpgMakerBuildFacts { CoreScript = "rmmz_core.js", CoreScriptVersion = "1.10.0" },
RenPy = new RenPyBuildFacts { VcVersion = "8.5.0.25111603" },
};
var detector = new StaticGameDetector(new ScriptedRules(BuildRules()), probe);
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FluentAssertions;
using FrameLedger.Domain.Detection;
namespace FrameLedger.Domain.Tests;
/// <summary>
/// The Ren'Py version (beta.20): the owner's one Ren'Py install as measured on 2026-10-12, the build number dropped as Ren'Py
/// names its releases, and nothing guessed from a version line that is not one.
/// </summary>
public sealed class RenPyVersionTests
{
[Fact]
public void TheMeasuredInstallReadsAsTheReleaseItWasBuiltWith() =>
RenPyVersion.Decide(new RenPyBuildFacts { VcVersion = "8.5.0.25111603" })
.Should().Be(new EngineVersionReading("8.5.0", EngineVersionSource.RenPyVcVersion), "Bound Between Desks: Ren'Py 8.5.0");
[Theory]
[InlineData("8.5.0.25111603", "8.5.0")]
[InlineData("8.3.7.25031702", "8.3.7")]
[InlineData("7.4.11.2266", "7.4.11")]
[InlineData("8.5.0", "8.5.0")]
[InlineData(" 8.5.0.25111603 ", "8.5.0")]
[InlineData("08.05.00.1", "8.5.0")]
[InlineData("8.5", null)]
[InlineData("8.5.0+nightly", null)]
[InlineData("In Good Health", null)]
[InlineData("0.5.0.1", null)]
[InlineData("", null)]
[InlineData(null, null)]
public void TheVersionLineGivesMajorMinorPatchOrNothing(string? vcVersion, string? expected)
{
EngineVersionReading r = RenPyVersion.Decide(new RenPyBuildFacts { VcVersion = vcVersion });
r.Version.Should().Be(expected);
r.Source.Should().Be(expected is null ? null : EngineVersionSource.RenPyVcVersion);
}
}
@@ -12,7 +12,8 @@ namespace FrameLedger.Infrastructure.Tests.Detection;
/// <summary>
/// beta.19's three readers over files the test writes in the shapes measured on the owner's installs (2026-10-12): a Unity
/// data file's header, a Godot pack beside the executable and one appended to it, RPG Maker MZ/MV core scripts and a VX Ace
/// <c>Game.ini</c>. Each reads a bounded head of one file and says nothing when the file is not what it expects.
/// <c>Game.ini</c> — and since beta.20 Ren'Py's <c>renpy/vc_version.py</c>. Each reads a bounded head of one file and says
/// nothing when the file is not what it expects.
/// </summary>
public sealed class EngineBuildReadersTests : IDisposable
{
@@ -166,4 +167,32 @@ public sealed class EngineBuildReadersTests : IDisposable
RpgMakerBuildReader.Read(Path.Combine(plain, "Plain.exe"), rgssLibrary: Path.Combine(plain, "RGSS202E.dll"))
.Should().Be(new RpgMakerBuildFacts { RgssLibrary = "RGSS202E.dll" }, "the walk's own find when no Game.ini names one");
}
/// <summary>
/// beta.20: Ren'Py's version line, from the engine's <c>renpy/vc_version.py</c> beside the launcher, in the shape measured
/// on Bound Between Desks — and nothing from a folder without the file, from a file whose lines name no version
/// (<c>version_name</c> is not <c>version</c>), or from past the bounded head.
/// </summary>
[Fact]
public async Task RenPysVersionLineIsReadFromTheEngineBesideTheLauncher()
{
string game = Sub("Bound Between Desks");
string engine = Sub("Bound Between Desks", "renpy");
string exe = Path.Combine(game, "BoundBetweenDesks.exe");
string versionFile = Path.Combine(engine, "vc_version.py");
await File.WriteAllBytesAsync(exe, new byte[8], Ct);
RenPyBuildReader.Read(exe).Should().BeNull("no version file");
await File.WriteAllTextAsync(versionFile, "branch = 'master'\nnightly = False\nofficial = True\nversion = '8.5.0.25111603'\nversion_name = 'In Good Health'\n", Ct);
RenPyBuildFacts? facts = RenPyBuildReader.Read(exe);
facts.Should().Be(new RenPyBuildFacts { VcVersion = "8.5.0.25111603" });
RenPyVersion.Decide(facts!).Should().Be(new EngineVersionReading("8.5.0", EngineVersionSource.RenPyVcVersion));
await File.WriteAllTextAsync(versionFile, "version_name = 'In Good Health'\nnightly = False\n", Ct);
RenPyBuildReader.Read(exe).Should().BeNull("a version name is not a version");
await File.WriteAllTextAsync(versionFile, new string('#', RenPyBuildReader.VersionFileBytes) + "\nversion = '8.5.0.1'\n", Ct);
RenPyBuildReader.Read(exe).Should().BeNull("only the bounded head is read");
}
}