sharkwouter / minigalaxy

A simple GOG client for Linux
https://sharkwouter.github.io/minigalaxy/
GNU General Public License v3.0
1.1k stars 71 forks source link

Feature/fix request: change priority of launcher types (and/or add per-game setting to override it) #523

Open LeXofLeviafan opened 2 years ago

LeXofLeviafan commented 2 years ago

As of now, the priority of launcher types (defined in minigalaxy.launcher.determine_launcher_type) is as follows:

  1. Wine (detected by existence of unins000.exe in game dir)
  2. DOSBox (detected by existence of dosbox both in game dir and in PATH; dosbox/ folder is only detected when in lowercase)
  3. ScummVM (detected by existence of scummvm both in game dir and in PATH; scummvm/ folder is only detected when in lowercase)
  4. Wine again (detected by existence of prefix in game dir)
  5. Native (detected by existence of start.sh in game dir)
  6. Fallback (also Wine but without custom WINEPREFIX)

I see two issues in this list:

To deal with these issues, I suggest following changes:

sharkwouter commented 2 years ago

Thanks for the detailed report, I appreciate the effort. Looking at it like this, I do think 4 and 5 should probably be switched.

When implementing using the native clients for scummvm and dosbox games I did actually try to do it for Windows games too, but it turns out that the configurations for them are not cross platform compatible. If a Dosbox configuration has in it that it uses DirectX as backend, you cannot launch the game with that configuration on Linux for example. There is an old issue for it here: https://github.com/sharkwouter/minigalaxy/issues/64

It would be cool to find a solution for that, but I'm not sure how big the scope would be for it.

LeXofLeviafan commented 2 years ago

I would say that making the file check case-insensitive would be a good thing on its own, regardless of priority order, as it's a rather unintuitive thing to be aware of when trying to run it natively. Also, this information (launcher detection logic) should probably be documented and made easily available to users (as in, “read this if you want to know how to run a DOS game in native DOSBox”); after all, knowing you need to remove a file named unins000.exe isn't quite intuitive either.

Additionally, having an explicit override in game properties (e.g. “run via ./start.sh” toggle) might make a lot of difference for the average user (as otherwise they wouldn't even be aware of possibility).

As for DOSBox/ScummVM having configs incompatible with Linux, there also should be an easy/clear way of switching between native/Wine versions. (Incidentally, out of all DOS games I've tried so far, only TES Redguard failed to run in native DOSBox using original configs; for pretty much all others, the only change I needed to make was replacing .. paths with . in mounting commands. For ScummVM, however, I had to add every game in GUI manually, and then put its ID as launch parameter.)

…Now that I think about it, there's another thing that got in the way when setting up native ScummVM games: the launcher doesn't work without an .ini file (even though it accepts an empty one), and when one is supplied it overrides global config (so if I want to play the game without running Minigalaxy I basically have to register it as a completely separate install).

sharkwouter commented 2 years ago

I've added this commit, which switches the prefix check and the setup.sh check around. Does that address your issue?

LeXofLeviafan commented 2 years ago

You mean this one? Yes, it does make room for Wine game customization.

The launcher detection logic should be visibly documented for this fix to be useful for others, though :-) (Adding a basic script example on top would also be good for user-friendliness purposes, I suppose.)

sharkwouter commented 2 years ago

Exactly, that's the one. This seems like a pretty niche use case, though, that's why I didn't document it. The important thing is that you know it's there and you can use it. Maybe some more people will leave a comment here on if this is useful to them, then I will document it.

LeXofLeviafan commented 2 years ago

…Just had a look at the same file in master; in that version of the file, order between these two doesn't matter as in both cases ["./start.sh"] is used. (Not sure how it's supposed to work with Wine… Unless start.sh is created automatically at some point, it's simply going to fail.)

    elif "prefix" in files and shutil.which("wine"):
        launcher_type = "wine"
    if launcher_type in ["start_script", "wine"]:
        exe_cmd = get_start_script_exe_cmd()
def get_start_script_exe_cmd():
    return ["./start.sh"]