Skip to content

Fix: BeamNG.drive not detected due to case-sensitive path mismatch in libraryfolders.vdf - #259

Open
SCPLEGION wants to merge 4 commits into
BeamMP:masterfrom
SCPLEGION:master
Open

Fix: BeamNG.drive not detected due to case-sensitive path mismatch in libraryfolders.vdf#259
SCPLEGION wants to merge 4 commits into
BeamMP:masterfrom
SCPLEGION:master

Conversation

@SCPLEGION

@SCPLEGION SCPLEGION commented Jul 7, 2026

Copy link
Copy Markdown

Steam's libraryfolders.vdf can record a library path with different casing than what's actually on disk (e.g. /mnt/hdd vs /mnt/HDD). On case-sensitive filesystems this made std::filesystem::exists() fail silently, so BeamNG.drive was never detected even when installed.
Changes:

Added TryResolveGameDir(): resolves a game's install path segment-by-segment, falling back to a case-insensitive directory scan when the exact-case path doesn't exist. Confirms success by checking for integrity.json in the resolved folder.
Added debug logging showing which Steam install/library path is being checked, to make future detection issues easier to diagnose.

Testing: verified against a library where the VDF path casing didn't match the actual mount point casing; BeamNG.drive is now detected correctly.


By creating this pull request, I understand that code that is AI generated or otherwise automatically generated may be rejected without further discussion.
I declare that I fully understand all code I pushed into this PR, and wrote all this code myself and own the rights to this code.

SCPLEGION added 2 commits July 7, 2026 13:06
Steam's libraryfolders.vdf can store a library path with different
casing than the actual filesystem path (e.g. /mnt/hdd vs /mnt/HDD),
which caused std::filesystem::exists() to fail and BeamNG.drive to go
undetected. Add TryResolveGameDir(), which retries each path segment
in upper/lower case until integrity.json is found.

Also add ~/.local/share/Steam/steamapps as a known Steam location
(Arch/Fedora and other distros without the .steam symlink), and log
which Steam install/library folder is being checked to aid debugging.
Copilot AI review requested due to automatic review settings July 7, 2026 11:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve BeamNG.drive detection on Linux when Steam’s libraryfolders.vdf records a library path whose casing doesn’t match the actual on-disk path on case-sensitive filesystems.

Changes:

  • Added TryResolveGameDir() to attempt resolving the BeamNG.drive install directory from a Steam library path.
  • Hardened libraryfolders.vdf parsing by adding null checks and safer access to the apps node before attempting detection.
  • Switched Linux detection to use the new resolver and (per PR intent) improve diagnosability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Security/BeamNG.cpp Outdated
Comment thread src/Security/BeamNG.cpp Outdated
Comment thread src/Security/BeamNG.cpp Outdated
Comment thread src/Security/BeamNG.cpp
Comment thread src/Security/BeamNG.cpp

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread src/Security/BeamNG.cpp Outdated
Comment thread src/Security/BeamNG.cpp

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/Security/BeamNG.cpp
kccricket added a commit to kccricket/BeamMP-Launcher that referenced this pull request Jul 8, 2026
Steam's libraryfolders.vdf can record a library path with different
casing than what's actually on disk (e.g. /mnt/hdd vs /mnt/HDD), which
made exact-case existence checks fail silently and left BeamNG.drive
undetected. Resolve each path segment case-insensitively as a fallback,
harden the VDF parsing against missing keys, and add a few more known
Steam install locations (native ~/.local/share/Steam, Debian package,
flatpak XDG data layout).

Incorporates and fixes upstream PR BeamMP#259 by SCPLEGION, addressing
review issues flagged on that PR (unguarded empty path falling back to
cwd, and using is_regular_file instead of exists for integrity.json).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CiJCjUHz8i7dSFiBek6XGq
IrPgFKS0 added a commit to IrPgFKS0/BeamMP-Launcher that referenced this pull request Jul 9, 2026
…st download site

- ServerSend keeps lowercase 'e' events on UDP (skip the >1KB TCP upgrade),
  BeamMP-Launcher#253 -- pairs with the mod/server UDP-event set.
- Atomic tmp+rename on the one remaining direct mod-copy site so BeamNG never
  mounts a half-written zip (BeamMP-Launcher#250; the fork already did this at
  the other download sites). (BeamMP#244 int-cast already present; Linux PRs
  BeamMP#223/BeamMP#247/BeamMP#259 skipped -- already present or not worth the launch-path risk.)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@SCPLEGION
SCPLEGION requested a review from Copilot July 16, 2026 21:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/Security/BeamNG.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants