altf4 / libmelee

Open Python 3 API for making your own Smash Bros: Melee AI that works with Slippi Online
GNU Lesser General Public License v3.0
237 stars 47 forks source link

Latest Slippi update changes binary name from Dolphin to Slippi Dolpin on Windows #68

Closed IAmAbszol closed 3 years ago

IAmAbszol commented 3 years ago

Issue: Dolphin executable renamed to Slippi Dolphin

A relatively swift fix would be to change the name within console.py:235 but this obviously wouldn't do for backwards compatibility.

exe_name = "dolphin-emu"
if platform.system() == "Windows":
    exe_name = "Dolphin.exe"
elif platform.system() == "Darwin":
    exe_name = "Slippi Dolphin"

Code block assumes Dolphin.exe is the default name, not always the case as seen.

I can tackle this tomorrow although coming up with a solution to find the correct binary might prove troublesome as we wouldn't want to run any binary in the directory. It might be better to hard code specify the binaries possible for Windows and test each one if they exist else print out a useful output rather than:

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    console.run()
  File "D:\Documents\Melee\FM-Slippi\testenv\lib\site-packages\melee\console.py", line 261, in run
    self._process = subprocess.Popen(command, env=env)
  File "C:\Users\Kyle\Anaconda3\Lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Kyle\Anaconda3\Lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
altf4 commented 3 years ago

I just pushed a fix in 0.23.1, see if that fixes it.

As for backwards compat, I don't think I want to bother with backwards compatibility. I just want to support whatever the latest is. In this case, I MAY add an exe name override option though? Not sure.