aboutsummaryrefslogtreecommitdiff
path: root/src/extras/findgame.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/extras/findgame.js')
-rw-r--r--src/extras/findgame.js26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/extras/findgame.js b/src/extras/findgame.js
index cfcb7aa..3beca23 100644
--- a/src/extras/findgame.js
+++ b/src/extras/findgame.js
@@ -43,26 +43,38 @@ module.exports = async () => {
if (fs.existsSync(data_array[0] + "/steamapps/common/Titanfall2/Titanfall2.exe")) {
console.log("Found game in:", data_array[0])
return data_array[0] + "/steamapps/common/Titanfall2";
+ } else {
+ console.log("Game not in:", data_array[0])
}
}
}
- let folder = null;
+ let folders = [];
switch (process.platform) {
case "win32":
- folder = "C:\\Program Files (x86)\\Steam\\steamapps\\libraryfolders.vdf";
+ folders = ["C:\\Program Files (x86)\\Steam\\steamapps\\libraryfolders.vdf"];
break
case "linux":
case "openbsd":
case "freebsd":
- folder = path.join(app.getPath("home"), "/.steam/steam/steamapps/libraryfolders.vdf");
+ let home = app.getPath("home");
+ folders = [
+ path.join(home, "/.steam/steam/steamapps/libraryfolders.vdf"),
+ path.join(home, ".var/app/com.valvesoftware.Steam/.steam/steam/steamapps/libraryfolders.vdf"),
+ path.join(home, ".var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/libraryfolders.vdf")
+ ]
break
}
- if (fs.existsSync(folder) && folder) {
- let data = fs.readFileSync(folder)
- let read_vdf = readvdf(data.toString())
- if (read_vdf ) {return read_vdf}
+ if (folders.length > 0) {
+ for (let i = 0; i < folders.length; i++) {
+ if (! fs.existsSync(folders[i])) {continue}
+ console.log("Searching VDF file at:", folders[i])
+
+ let data = fs.readFileSync(folders[i])
+ let read_vdf = readvdf(data.toString())
+ if (read_vdf) {return read_vdf}
+ }
}
if (gamepath) {