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

fix: unable to install games on linux #304

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

scrlkx
Copy link

@scrlkx scrlkx commented May 12, 2024

There is a issue when installing games on Linux. I described it in #299.

Fixes #299

@scrlkx scrlkx changed the title fix: game installing do not reach linux steps fix: unable to install games on linux May 26, 2024
@zamitto
Copy link
Collaborator

zamitto commented May 26, 2024

Finally got able to install a linux disto on my PC, will test your PR today

@zamitto
Copy link
Collaborator

zamitto commented May 27, 2024

Gonna post here the same commend I posted on #299 just to make it more visible:

May I suggest something?

  1. If there is a setup.exe inside the gamePath, we call wine ${setupPath} and return
  2. If there is not a setup.exe but there is any other .exe file, we call wine ${gamePath}
  3. If not, we open the directory using shell.openPath(gamePath)

The Windows conditional remains the same as it is in your PR. These checks should happen after that.

@zamitto zamitto added this to the v1.3.0 milestone May 28, 2024
@zamitto
Copy link
Collaborator

zamitto commented May 30, 2024

Hey @scrlkx any changes you can work on those changes today? We'd like to merge this PR today to start the tests for the next release
If you are busy or anything, no problem, I probably can commit the changes we talked about on #299

@scrlkx
Copy link
Author

scrlkx commented May 30, 2024

I'll have a free time later today and I'm planning to take a look into it. Feel free to apply any changes though.

@scrlkx
Copy link
Author

scrlkx commented May 31, 2024

I have implemented the changes you suggested with one single consideration: the first step of the installation process is now to check if the game path actually leads to a file (not a directory). If it does, we proceed to execute it, assuming it is the game installer. This is important for cases like 18 Wheels of Steel: Across America, where the game comes as a single file, and it also makes all other handling more reasonable.

Additionally, I created a function to execute files based on the operating system. This way, we avoid duplicating the Wine logic.

I tested these changes using different games that come in various formats, including:

  1. Rabbit and Stell - which comes in a single compressed file.
  2. 18 Wheels of Steel: Across America - which comes as a single executable file.
  3. A Little to the Left - which comes in a folder with a setup.exe file.
  4. BIT.TRIP Rerunner - which comes in a folder with a setup.exe file that I renamed to installer.exe to stage the scenario where there is an installer with a different name.

Everything seems to be working well.

It's important to note that the Lutris logic has become less useful as we now employ a Wine-first approach. However, this doesn't seem like a problem since the current Lutris implementation relies on having a setup.exe file available, and seems out of place to be honest. I do think we can make it more useful based on the insights we brought up in #505.

Let me know if you think something should be different or seems wrong.

.gitignore Outdated Show resolved Hide resolved
@zamitto
Copy link
Collaborator

zamitto commented May 31, 2024

The only thing I'm worried is if there are any game that can have more than one .exe file inside de download folder. I've never seen an example like that, but i don't know...

@scrlkx
Copy link
Author

scrlkx commented May 31, 2024

It's a fair concern. We could improve what we have by looking for something similar to "setup.exe", "{gamename}.exe", you name it. There is no silver bullet though. I do think this PR improve some cases, I had one with NFS (I think) where it comes with a "nfs-something.exe" and it was well handled, so...

@scrlkx
Copy link
Author

scrlkx commented May 31, 2024

Ideally we would know exactly what to run, but as it's not possible right now we will have to do some assumptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Installers are not handled correctly on Linux (using Lutris or Wine)
3 participants