Detect if running under Wine #27

Closed
opened 2022-07-19 13:16:42 +02:00 by williamjcm · 1 comment
Owner

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.

As per [this answer on Stack Overflow](https://stackoverflow.com/a/42333249/4084782), 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.
williamjcm added this to the v1.4.0 milestone 2022-07-19 13:16:42 +02:00
williamjcm added the
enhancement
label 2022-07-19 13:16:42 +02:00
williamjcm self-assigned this 2022-07-19 13:16:42 +02:00
williamjcm removed this from the v1.4.0 milestone 2022-11-21 08:34:53 +01:00
williamjcm removed reference the-road-to-1point4 2022-11-21 08:36:27 +01:00
williamjcm added this to the v1.5.0 milestone 2023-08-20 17:41:28 +02:00
Author
Owner

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 of utf8.

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.

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 of `utf8`. 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.
williamjcm added reference one-point-five 2023-08-20 17:59:17 +02:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: williamjcm/MassBuilderSaveTool#27
No description provided.