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

Python error when clicking Launch #633

Open
manuq opened this issue Jan 2, 2025 · 7 comments
Open

Python error when clicking Launch #633

manuq opened this issue Jan 2, 2025 · 7 comments

Comments

@manuq
Copy link

manuq commented Jan 2, 2025

Trying Minigalaxy from Flathub with Spelunky GOG game. This is a Windows game and the Wine rating is "platinum", so I guess it should play fine. The installation went fine. But then when clicking Launch nothing happens. I ran the flatpak from CLI to see the error, and it's the following Python IndexError. By clicking on "Properties" -> "Open Files" I can navigate to app/Spelunky.exe so an executable seems to exist.

$ flatpak run io.github.sharkwouter.Minigalaxy
Traceback (most recent call last):
  File "/app/lib/python3.11/site-packages/minigalaxy/ui/gametile.py", line 120, in on_button_click
    err_msg = start_game(self.game)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/minigalaxy/launcher.py", line 48, in start_game
    error_message, process = run_game_subprocess(game)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/minigalaxy/launcher.py", line 205, in run_game_subprocess
    get_execute_command(game),
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/minigalaxy/launcher.py", line 65, in get_execute_command
    exe_cmd = get_windows_exe_cmd(game, files)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/lib/python3.11/site-packages/minigalaxy/launcher.py", line 142, in get_windows_exe_cmd
    filename = os.path.splitext(os.path.basename(executables[0]))[0] + '.exe'
                                                 ~~~~~~~~~~~^^^
IndexError: list index out of range

Captura desde 2025-01-02 11-20-43

@GB609
Copy link
Collaborator

GB609 commented Jan 2, 2025

The issue here is that the exe file for Spelunky (and everything else) is located in a sub-directory of the game directory. Minigalaxy expects the files to be located in the 'root' game directory, .../GOG Galaxy/Spelunky in your case.
Normally, the installation in minigalaxy should take care of this, but there are a few open issues related to windows game installations in the recent releases of minigalaxy.

Could you provide some more information about your system and the installation of the game:

  • What's your Minigalaxy version?
  • Do you have innoextract installed (or might it even be packaged into the flatpak)?
  • What's the content of the goggame-*.info file? This file is located in the wrong directory, but it normally should contain information about how to launch a game and where to find the *.exe file.

@manuq
Copy link
Author

manuq commented Jan 2, 2025

The issue here is that the exe file for Spelunky (and everything else) is located in a sub-directory of the game directory. Minigalaxy expects the files to be located in the 'root' game directory, .../GOG Galaxy/Spelunky in your case. Normally, the installation in minigalaxy should take care of this, but there are a few open issues related to windows game installations in the recent releases of minigalaxy.

Hey thanks for explaining the reason!

Could you provide some more information about your system and the installation of the game:

  • What's your Minigalaxy version?

I have my flatpak up-to-date with flathub. About me dialogue says: 1.3.1. Which matches the flatpak manifest

  • Do you have innoextract installed (or might it even be packaged into the flatpak)?

Yes it looks like this comes with the flatpak, and the version is as follows:

$ flatpak run --command=bash io.github.sharkwouter.Minigalaxy
[📦 io.github.sharkwouter.Minigalaxy ~]$ innoextract -v
innoextract 1.9 + 81fd9b9
Extracts installers created by Inno Setup 1.2.10 to 6.0.5
  • What's the content of the goggame-*.info file? This file is located in the wrong directory, but it normally should contain information about how to launch a game and where to find the *.exe file.

This is the content:


{
    "gameId" : "1207659257",
    "rootGameId" : "1207659257",
    "dependencyGameId" : "",
    "language"         : "english",
    "name"             : "Spelunky",
    "playTasks"        : [
        {
            "isPrimary" : true,
            "type"      : "FileTask",
            "path"      : "Spelunky.exe",
            "workingDir" : ""
        }
    ],
    "supportTasks"     : [
        {
            "name" : "Support",
            "type" : "URLTask",
            "link" : "http://www.gog.com/en/support/spelunky"
        }
    ]
}

@GB609
Copy link
Collaborator

GB609 commented Jan 2, 2025

Thanks for the input.

If you just want to play, there are a few things you could try.

  1. In your current installation, move everything placed in app/ (including any hidden files) up one level, to be contained directly in Spelunky, then try to run via minigalaxy again. This should work for simple games that don't require registry keys.
  2. You could also try to install via a native version of minigalaxy while NOT having innoextract in the PATH (basically not installed), or manipulate the flatpak somehow to remove innoextract from PATH if possible. Sadly there is no way to enable/disable installation via innoextract aside from not having it installed at all.
  3. I've actually reworked quite a large part of the windows installation procedure and merged it to the master branch, but it is not tagged+released yet. You could also try to directly use the current developer version, if you follow the instructions at the Wiki. I've test-installed around 10 - 15 different windows games with that without an issue with that version so far.
  4. Set minigalaxy to also download the installers (if not done already), then try to install in minigalaxy once for it to download the installer if necessary. Afterwards navigate to path/to/GOG Games/installer/Spelunky to run the installer manually.
    This requires the following commands, but please make sure that the Spelunky/prefix directory either doesn't exist or is empty:
mkdir -p "/absolute/path/to/GOG Games/Spelunky/prefix"
WINEPREFIX="/absolute/path/to/GOG Games/Spelunky/prefix" wine setup_spelunky*.exe

This will start the regular graphical GOG installer. Make sure to pick z:/absolute/path/to/GOG Games/Spelunky as install directory, otherwise registry keys will be broken. Then just proceed with the installation.

@manuq
Copy link
Author

manuq commented Jan 2, 2025

Thanks for the input.

If you just want to play, there are a few things you could try.

  1. In your current installation, move everything placed in app/ (including any hidden files) up one level, to be contained directly in Spelunky, then try to run via minigalaxy again. This should work for simple games that don't require registry keys.

This worked, thanks! Should we keep the issue open? I will be able to test this again in a future flatpak release if you want me to confirm that the bug is gone.

@sharkwouter
Copy link
Owner

I'm glad you were able to resolve this. I'll do think we should keep this open for now, because there are a couple of games that do not launch for the same reason. I'll work on a fix for this.

@GB609
Copy link
Collaborator

GB609 commented Jan 5, 2025

This might already be mostly resolved (for new installations) on the master branch where we moved away from innoextract installation. With the exception of some games that dont have a usable *.info file.

@sharkwouter
Copy link
Owner

It still applies for Unreal Gold.

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

No branches or pull requests

3 participants