Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checks for Steam Linux install locations #131

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/main/java/lmr/randomizer/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,26 @@ private Settings() {
minRandomRemovedItems = 0;
maxRandomRemovedItems = 0;

// Check for Linux Steam installs. The "HOME" environment variable typically only exists on Linux and returns "/home/[user]".
// If requested on Windows it'll return null, hence the null check.
// The Linux GOG check could possibly be moved up here as well.
// Added by Nat the Chicken, March 2023.
String linuxUserPath = System.getenv("HOME");
if (linuxUserPath != null) {
for (String filename : Arrays.asList("/.steam/debian-installation/steamapps/common/La-Mulana", //the usual location
"/.steam/root/steamapps/common/La-Mulana", //this is usually a symlink to the real install and serves as a catch-all
"/.local/share/Steam/steamapps/common/La-Mulana")) { //just in case they have an ANCIENT installation
if (new File(linuxUserPath + filename).exists()) {
laMulanaBaseDir = linuxUserPath + filename;
break;
}
}
}

for (String filename : Arrays.asList("C:\\Games\\La-Mulana Remake 1.3.3.1", "C:\\GOG Games\\La-Mulana", "C:\\GOG Games\\La-Mulana",
"C:\\Steam\\steamapps\\common\\La-Mulana", "C:\\Program Files (x86)\\Steam\\steamapps\\common\\La-Mulana",
"C:\\Program Files\\Steam\\steamapps\\common\\La-Mulana", "C:\\Program Files (x86)\\GOG Galaxy\\Games\\La Mulana",
"C:\\Program Files (x86)\\GOG.com\\La-Mulana"
/* Steam on Linux path? */)) {
"C:\\Program Files (x86)\\GOG.com\\La-Mulana")) {
if (new File(filename).exists()) {
laMulanaBaseDir = filename;
break;
Expand Down