Closed scrlkx closed 4 months ago
Ok, let me see if I understood your issue and PR (I'm I downloaded two games Crow Country and Rabit and Steel.
It has a setup.exe
inside the download folder. So with and without your PR, wine opens the setup.exe
It has a .rar file inside the download folder.
Is this the expected result when the download does not have a setup.exe?
When I created this issue I was trying to install a game that had an installer file but it was not called setup.exe
. I should have mentioned the game's name in the issue, as I can't remember it anymore. I assumed that it was not common for a game to have a setup.exe
and that games tend to come with different installer names. I did some tests by installing some random games today and noticed that this is not the case.
Just to clarify:
shell.openPath(gamePath)
, as it would open the folder in the file manager, allowing the user to install the game themselves. This means my PR makes things worse.In both cases, I think adding a dialog saying "The game installer was not found, please check yourself and add the game to the library later" would be good.
The game I was trying to install was 18 Wheels of Steel: Across America.
May I suggest something?
setup.exe
inside the gamePath
, we call wine ${setupPath}
and returnsetup.exe
but there is any other .exe
file, we call wine ${gamePath}
shell.openPath(gamePath)
The Windows conditional remains the same as it is in your PR. These checks should happen after that.
What do you think @scrlkx? If you think it is good enough, could you implement this in your PR?
I think it solves both problems
That's sounds good, I will take another look into it later.
Describe the bug We already have the ability to handle running game installers using Lutris or Wine as you can see here and here.
However, there is something wrong on the lines above it. We have an extra logic that appends a
setup.exe
to the file path which results in an invalid path to the game file. And, when this path is not found, we just callshell.openPath(gamePath)
and, as Linux doesn't know how to open .exe files, it just does it's best opening with Archive Manager or something like that.That means the lines that handle opening the installer with Lutris or Wine never reach. Removing this piece of code seems to fix the issue, but I assume they are there for a reason?
On the lines above,
gamePath
is a valid path (pointing to the installer file), butsetupPath
it's not.fs.existsSync(setupPath)
will always befalse
so we will always doshell.openPath(gamePath);
.To Reproduce Steps to reproduce the behavior:
Note that, what will happend after you click install depends on which distribution/desktop environment you are running. In case of GNOME it should open Archive Manager.
Expected behavior In case Lutris or Wine are installed, the game installer should open on them. I'm not so sure about what should happen if they are not.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context