-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Automatically find Titanfall installation folder #34
Comments
We can not. Since it's completely user based (because of Wine), the best we could do is check for if Lutris is installed which has a CLI tool to get paths for installed games and alike, as for executing that command, just use |
Is a PR for Windows worth then? |
I think it is, it'll make the install process far easier for the end user, as they may not even know where it is, and the whole point of Viper is to make everything easier. So I think it's a good idea to implement this.
Currently nothing is implemented because simply running the executable will launch the game with the system Wine not Proton, along with no env variables or anything that may or may not be needed to get it running. However I will be implementing a way for people to add their own custom command to launch, and try and detect most things (if the user is using Steam or Lutris) |
Lemme work on this. |
That'd be very nice, because I don't have an easy way to test things in a Windows environment :p |
I hope you'll be able to help me on the Linux part! |
I will, don't worry, it is mildly more complicated, but I'll handle that part if you want me to. |
I never tried to run a game on Linux actually, so I don't even know where to start... There are several possibilities, right? |
Lutris is simply a program that runs complex scripts to setup games to work and circumvent issues because a game wasn't meant for Linux etc, whether it be a native game or through Wine Wine is a compatibility layer which simply translates Windows code to Linux, and thereby allows running Windows programs (not an emulator btw, Wine literally stands for Wine-Is-Not-(an)-Emulator)). Proton is Valve's fork of Wine which focuses on fixing compatibility with games specifically, while the WineHQ team will usually just focus on getting Windows API's translated, hence it's just recommended to use Proton-runtime over the official Wine one. I personally run my games through Lutris with Proton-GE (a fork of Proton), along with several environment variables, and with all that there's no easy way to assume how to start the game, hence the issue I have in #38 However if a user uses Steam which'll use Proton, we can ask Steam "where's this game" and it'll reply, Lutris also has those cli options, however a user may be using a completely different setup or way of starting Titanfall. Which makes it hard, however we can still somewhat retrieve it, more importantly if a user isn't using Lutris or Steam to install they likely know where they install it and are tech savvy enough to set it manually.
The easiest way to get going is either through Steam or Lutris, I did the latter, then after it's installed rename or change which executable is being started from I lately had some issues with Northstar not being able to authenticate with Origin, originally I had it all in one game in Lutris, where I just ran Northstar Launcher, it'd auto run Origin to authenticate, but for some reason that broke, if I then ran Origin by itself it figured it all out. It happened right after an Origin update, so it's likely something messed with credentials or alike, I don't really know... |
Just thought I'd give you a simple but cross platform answer I found.
On my Linux installation this file is at The content of this file for me is:
From this you can find where TF2 is installed just by parsing it. Here's two .vdf parsers I found: |
I only think that's actually useful for Linux, as the PowerShell/ |
Isn't that only going to work if the game has been run at least one? |
Likely, unless the installer sets up the regkeys, likely not. However I think we should at least prioritize it, and if nothing is found use the VDF method as a fallback. |
I agree, makes most sense as a fallback, and it also works on Linux. |
I would also say using rossengeorgiev's parser would probably be the best idea here... |
Here's a simple script I did that finds the path of Titanfall 2 vdf = require('simple-vdf');
const fs = require('fs')
fs.readFile('/home/reee/.steam/steam/steamapps/libraryfolders.vdf', 'utf-8',
function (err,vdf_text) {
if (err) {
return console.log(err);
}
data = vdf.parse(vdf_text);
//data['libraryfolders']
// `.length - 1` This is because the last value is `contentstatsid`
for (let pathIterator = 0; pathIterator < Object.values(data['libraryfolders']).length - 1; pathIterator++) {
let data_array = Object.values(data['libraryfolders'][pathIterator])
// Print current location
console.log("=== %s ===", data_array[0])
if (fs.existsSync(data_array[0] + "/steamapps/common/Titanfall2/")) {
console.log("TITANFALL FOUND AT: %s", data_array[0])
}
}
}); |
I have not tested it on Windows yet though |
I've forked and started working on automatic detection, I'll open a PR once I'm done |
On Windows, by running
Get-Item -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Respawn\Titanfall2\
, you can get game folder, without having to ask user for it.I don't know if we can find game folder this way on Linux?
The text was updated successfully, but these errors were encountered: