Detect if running under Wine #27
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: williamjcm/MassBuilderSaveTool#27
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As per this answer on Stack Overflow, it's possible to detect if code is running under Wine or not. Would be useful for people who play MB on the Steam Deck or Linux in general, as the path to the game's saves is obviously gonna be different.
EDIT: For Linux, look into providing an AppImage instead of adding Wine compatibility. Wine detection could be used to redirect towards the native build of the app.
More testing makes it really easy to detect Wine/Proton: when trying to use the UTF-8 codepage (see #29), the string returned by Wine's implementation of
std::setlocale()
ends in the codepage's underlying numeric ID, instead ofutf8
.As a result, checking for that should be enough to detect Wine/Proton.
Not gonna bother with that, though. I'll actually just add the new sufix to the list of whitelisted suffixes, and ask people to run it through Protontricks or similar.