Repository: lutris/lutris

Issue:
Python error with runner for Epic Games Launcher
### Bug description

I tried to install the Epic Games Launcher on my ideapad. I always got the following error (from a git clone from yesterday). -d output below.


### How to Reproduce

Steps to reproduce the behavior:
1. Click on the + for new game
2. Search for Rocket League (or any other game in Epic Games Launcher)
3. Install


### Expected behavior

I would expect Lutris to install the Epic Games Launcher

### Log output

```shell
$ ./bin/lutris -d
INFO     2022-04-24 15:12:55,513 [startup.init_lutris:173]:Starting Lutris 0.5.10.1
WARNING  2022-04-24 15:12:55,546 [libretro.get_libretro_cores:24]:No folder at $HOME/.local/share/lutris/runners/retroarch/
DEBUG    2022-04-24 15:12:55,556 [xrandr._get_vidmodes:15]:Retrieving video modes from XrandR
DEBUG    2022-04-24 15:12:55,605 [schema.create_table:190]:[PGAQuery] CREATE TABLE IF NOT EXISTS games (id INTEGER PRIMARY KEY, name TEXT, slug TEXT, installer_slug TEXT, parent_slug TEXT, platform TEXT, runner TEXT, executable TEXT, directory TEXT, updated DATETIME, lastplayed INTEGER, installed INTEGER, installed_at INTEGER, year INTEGER, configpath TEXT, has_custom_banner INTEGER, has_custom_icon INTEGER, playtime REAL, hidden INTEGER, service TEXT, service_id TEXT)
DEBUG    2022-04-24 15:12:55,612 [schema.create_table:190]:[PGAQuery] CREATE TABLE IF NOT EXISTS service_games (id INTEGER PRIMARY KEY, service TEXT, appid TEXT, name TEXT, slug TEXT, icon TEXT, logo TEXT, url TEXT, details TEXT, lutris_slug TEXT)
DEBUG    2022-04-24 15:12:55,615 [schema.create_table:190]:[PGAQuery] CREATE TABLE IF NOT EXISTS sources (id INTEGER PRIMARY KEY, uri TEXT UNIQUE)
DEBUG    2022-04-24 15:12:55,618 [schema.create_table:190]:[PGAQuery] CREATE TABLE IF NOT EXISTS categories (id INTEGER PRIMARY KEY, name TEXT UNIQUE)
DEBUG    2022-04-24 15:12:55,621 [schema.create_table:190]:[PGAQuery] CREATE TABLE IF NOT EXISTS games_categories (game_id INTEGER, category_id INTEGER)
INFO     2022-04-24 15:12:55,625 [startup.check_driver:65]:Running Intel Mesa driver 21.2.6 on Mesa Intel(R) UHD Graphics 620 (WHL GT2) (0x3ea0)
INFO     2022-04-24 15:12:55,626 [startup.check_driver:77]:GPU: 8086:3EA0 17AA:39ED (i915 drivers) MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0
INFO     2022-04-24 15:12:55,666 [startup.update_runtime:213]:Startup complete
DEBUG    2022-04-24 15:12:55,760 [lutriswindow.update_store:437]:Showing 0 games
DEBUG    2022-04-24 15:12:58,266 [xrandr._get_vidmodes:15]:Retrieving video modes from XrandR
DEBUG    2022-04-24 15:12:58,468 [xrandr._get_vidmodes:15]:Retrieving video modes from XrandR
DEBUG    2022-04-24 15:12:58,491 [xrandr._get_vidmodes:15]:Retrieving video modes from XrandR
DEBUG    2022-04-24 15:12:58,516 [xrandr._get_vidmodes:15]:Retrieving video modes from XrandR
DEBUG    2022-04-24 15:12:58,595 [application.show_window:332]:Showing window RunnerConfigDialogwine
DEBUG    2022-04-24 15:13:06,782 [config.save:229]:Saving LutrisConfig(level=runner, game_config_id=None, runner=wine) config to $HOME/.config/lutris/runners/wine.yml
DEBUG    2022-04-24 15:13:06,797 [application.on_app_window_destroyed:350]:Removed window RunnerConfigDialogwine
DEBUG    2022-04-24 15:13:08,776 [application.show_window:332]:Showing window AddGamesWindow{}
DEBUG    2022-04-24 15:13:15,309 [http.get:83]:GET https://lutris.net/api/games?search=rocket+league&with-installers=True
DEBUG    2022-04-24 15:13:16,542 [api.get_game_installers:160]:Fetching installer https://lutris.net/api/installers/rocket-league
DEBUG    2022-04-24 15:13:16,543 [http.get:83]:GET https://lutris.net/api/installers/rocket-league
DEBUG    2022-04-24 15:13:16,782 [application.show_window:332]:Showing window InstallerWindowrocket-league
DEBUG    2022-04-24 15:13:16,782 [application.on_app_window_destroyed:350]:Removed window AddGamesWindow{}
DEBUG    2022-04-24 15:13:17,770 [xrandr._get_vidmodes:15]:Retrieving video modes from XrandR
INFO     2022-04-24 15:13:20,174 [runner.get_runner_version:324]:Getting runner information for wine
DEBUG    2022-04-24 15:13:20,174 [http.get:83]:GET https://lutris.net/api/runners/wine
DEBUG    2022-04-24 15:13:20,325 [interpreter.get_runners_to_install:223]:Default wine version is lutris-fshack-7.2
INFO     2022-04-24 15:13:20,326 [interpreter.get_runners_to_install:237]:Runner <lutris.runners.wine.wine object at 0x7f418ac92d00> needs to be installed
DEBUG    2022-04-24 15:13:20,342 [interpreter.install_runner:253]:Installing wine
DEBUG    2022-04-24 15:13:20,343 [runner.install:369]:Installing wine (version=lutris-fshack-7.2-x86_64, downloader=<function simple_downloader at 0x7f418b99bca0>, callback=<bound method ScriptInterpreter.install_runners of <interpreter.ScriptInterpreter object at 0x7f418acf7e40 (lutris+installer+interpreter+ScriptInterpreter at 0x23bf180)>>)
INFO     2022-04-24 15:13:20,343 [runner.get_runner_version:324]:Getting runner information for wine (version: lutris-fshack-7.2-x86_64)
DEBUG    2022-04-24 15:13:20,343 [http.get:83]:GET https://lutris.net/api/runners/wine
DEBUG    2022-04-24 15:13:20,505 [downloader.start:65]:⬇https://github.com/lutris/wine/releases/download/lutris-wine-7.2/wine-lutris-fshack-7.2-x86_64.tar.xz
DEBUG    2022-04-24 15:13:29,068 [downloader.download_cb:125]:Finished downloading https://github.com/lutris/wine/releases/download/lutris-wine-7.2/wine-lutris-fshack-7.2-x86_64.tar.xz
DEBUG    2022-04-24 15:13:29,528 [extract.extract_archive:123]:Extracting $HOME/.cache/lutris/wine-lutris-fshack-7.2-x86_64.tar.xz to $HOME/.local/share/lutris/runners/wine/lutris-fshack-7.2-x86_64
DEBUG    2022-04-24 15:13:36,860 [system.remove_folder:229]:Removing folder $HOME/.local/share/lutris/runners/wine/lutris-fshack-7.2-x86_64/.extract-199d3cd7
DEBUG    2022-04-24 15:13:36,860 [extract.extract_archive:175]:Finished extracting $HOME/.cache/lutris/wine-lutris-fshack-7.2-x86_64.tar.xz to $HOME/.local/share/lutris/runners/wine/lutris-fshack-7.2-x86_64
DEBUG    2022-04-24 15:13:36,868 [runner.extract:425]:Clearing wine version cache
DEBUG    2022-04-24 15:13:36,868 [interpreter.get_extras:159]:Checking if service provide extra files
DEBUG    2022-04-24 15:13:36,868 [installer.prepare_game_files:146]:No service to retrieve files from
DEBUG    2022-04-24 15:13:36,872 [interpreter.create_game_folder:181]:Creating destination path $HOME/Games/rocket-league
DEBUG    2022-04-24 15:13:45,667 [downloader.start:65]:⬇ https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncherInstaller.msi
DEBUG    2022-04-24 15:13:59,716 [downloader.download_cb:125]:Finished downloading https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncherInstaller.msi
INFO     2022-04-24 15:14:00,194 [file_box.on_download_complete:252]:Download completed
DEBUG    2022-04-24 15:14:00,194 [files_box.on_file_available:93]:epic is available
INFO     2022-04-24 15:14:00,195 [files_box.on_file_available:99]:All files available
INFO     2022-04-24 15:14:00,195 [installerwindow.on_files_available:463]:All files are available, continuing install
DEBUG    2022-04-24 15:14:00,198 [interpreter._iter_commands:317]:Installer command: {'task': {'arch': 'win64', 'name': 'create_prefix', 'prefix': '$GAMEDIR'}}
INFO     2022-04-24 15:14:00,201 [wine.create_prefix:96]:Creating a win64 prefix in $HOME/Games/rocket-league
DEBUG    2022-04-24 15:14:00,201 [system.execute:56]:Executing $HOME/.local/share/lutris/runners/wine/lutris-fshack-7.2-x86_64/bin/wineboot
DEBUG    2022-04-24 15:14:00,201 [system.execute:62]:WINEARCH=win64
WINEPREFIX=$HOME/Games/rocket-league
WINEDLLOVERRIDES=winemenubuilder=
WINE_MONO_CACHE_DIR=$HOME/.local/share/lutris/runners/wine/lutris-fshack-7.2-x86_64/mono
WINE_GECKO_CACHE_DIR=$HOME/.local/share/lutris/runners/wine/lutris-fshack-7.2-x86_64/gecko
INFO     2022-04-24 15:14:23,800 [wine.create_prefix:150]:win64 Prefix created in $HOME/Games/rocket-league
DEBUG    2022-04-24 15:14:23,851 [interpreter._iter_commands:317]:Installer command: {'task': {'app':
'arial cjkfonts vcrun2019 d3dcompiler_43 d3dcompiler_47 d3dx9', 'arch':
'win64', 'name': 'winetricks', 'prefix': '$GAMEDIR'}}
sh: 0: getcwd() failed: No such file or directory
DEBUG    2022-04-24 15:14:23,879 [wine.use_lutris_runtime:115]:$HOME/.local/share/lutris/runners/wine/lutris-fshack-7.2-x86_64/bin/wine is provided by Lutris, using runtime
DEBUG    2022-04-24 15:14:23,999 [wine.detect_prefix_arch:81]:Prefix not found: $HOME/.wine
WARNING  2022-04-24 15:14:24,135 [prefix.get_desktop_folders:139]:Couldn't load shell folder name for Desktop
WARNING  2022-04-24 15:14:24,135 [prefix.get_desktop_folders:139]:Couldn't load shell folder name for Personal
WARNING  2022-04-24 15:14:24,135 [prefix.get_desktop_folders:139]:Couldn't load shell folder name for My Music
WARNING  2022-04-24 15:14:24,135 [prefix.get_desktop_folders:139]:Couldn't load shell folder name for My Videos
WARNING  2022-04-24 15:14:24,135 [prefix.get_desktop_folders:139]:Couldn't load shell folder name for My Pictures
DEBUG    2022-04-24 15:14:24,235 [wine.detect_prefix_arch:81]:Prefix not found: $HOME/.wine
ERROR    2022-04-24 15:14:24,235 [jobs.target:36]:Error while completing task <bound method CommandsMixin.task of <interpreter.ScriptInterpreter object at 0x7f418acf7e40 (lutris+installer+interpreter+ScriptInterpreter at 0x23bf180)>>: <class 'FileNotFoundError'> [Errno 2] No such file or directory:
'$HOME/.local/share/lutris/runtime/dxvk/dxvk_versions.json'
  File "$HOME/lutris/lutris/util/jobs.py", line 34, in target
    result = self.function(*args, **kwargs)
  File
"$HOME/lutris/lutris/installer/commands.py", line 436, in task
    command = task(**data)
  File
"$HOME/lutris/lutris/runners/commands/wine.py",
line 349, in winetricks
    return wineexec(
  File
"$HOME/lutris/lutris/runners/commands/wine.py",
line 302, in wineexec
    wine.prelaunch()
  File "$HOME/lutris/lutris/runners/wine.py",
line 801, in prelaunch
    self.setup_dlls(
  File "$HOME/lutris/lutris/runners/wine.py",
line 780, in setup_dlls
    dll_manager.enable()
  File
"$HOME/lutris/lutris/util/wine/dll_manager.py",
line 213, in enable
    if not self.download():
  File
"$HOME/lutris/lutris/util/wine/dll_manager.py",
line 118, in download
    url = self.get_download_url()
  File
"$HOME/lutris/lutris/util/wine/dll_manager.py",
line 105, in get_download_url
    with open(self.versions_path, "r", encoding='utf-8') as version_file:
ERROR    2022-04-24 15:14:24,237 [interpreter._iter_commands:302]:Last install command failed, show error
INFO     2022-04-24 15:14:31,220 [interpreter.revert:374]:Cancelling installation of Rocket League
DEBUG    2022-04-24 15:14:31,225 [wine.winekill:168]:Killing all wine processes:
['$HOME/.local/share/lutris/runners/wine/lutris-fshack-7.2-x86_64/bin/wineserver',
'-k']
DEBUG    2022-04-24 15:14:31,226 [wine.winekill:169]:    Wine prefix: $HOME/Games/rocket-league
DEBUG    2022-04-24 15:14:31,226 [wine.winekill:170]:    Wine arch: win64
DEBUG    2022-04-24 15:14:31,238 [wine.winekill:176]:Waiting for wine processes to terminate
DEBUG    2022-04-24 15:14:31,238 [wine.winekill:192]:Done waiting.
DEBUG    2022-04-24 15:14:31,239 [system.remove_folder:229]:Removing folder $HOME/Games/rocket-league
DEBUG    2022-04-24 15:14:31,396 [system.remove_folder:229]:Removing folder $HOME/.cache/lutris/installer/rocket-league
DEBUG    2022-04-24 15:14:31,409 [application.on_app_window_destroyed:350]:Removed window InstallerWindowrocket-league
DEBUG    2022-04-24 15:15:00,348 [xrandr._get_vidmodes:15]:Retrieving video modes from XrandR
DEBUG    2022-04-24 15:15:00,452 [application.show_window:332]:Showing window RunnerConfigDialogwine
DEBUG    2022-04-24 15:15:05,263 [application.on_app_window_destroyed:350]:Removed window RunnerConfigDialogwine
INFO     2022-04-24 15:20:00,184 [application.do_shutdown:885]:Shutting down Lutris
```


### System Information

```shell
[System]
OS:              Linux Mint 20.3 una
Arch:            x86_64
Kernel:          5.4.0-109-generic
Desktop:         X-Cinnamon
Display Server:  x11

[CPU]
Vendor:          GenuineIntel
Model:           Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
Physical cores:  4
Logical cores:   8

[Memory]
RAM:             7.5 GB
Swap:            2.0 GB

[Graphics]
Vendor:          Intel
OpenGL Renderer: Mesa Intel(R) UHD Graphics 620 (WHL GT2)
OpenGL Version:  4.6 (Compatibility Profile) Mesa 21.2.6
OpenGL Core:     4.6 (Core Profile) Mesa 21.2.6
OpenGL ES:       OpenGL ES 3.2 Mesa 21.2.6
Vulkan:          Supported
```


### Media (optional)

_No response_

### Checklist:

- [X] I'm not asking for support with a game or the wine runner.
- [X] I have followed the above mentioned guides and have all the graphics and wine dependencies installed.
- [X] I have checked for existing issues that describe my problem prior to opening this one.
- [X] I understand that improperly formatted bug reports may be closed without explanation.


Discussion:

Resolving patch:
diff --git a/lutris/util/wine/dll_manager.py b/lutris/util/wine/dll_manager.py
--- a/lutris/util/wine/dll_manager.py
+++ b/lutris/util/wine/dll_manager.py
@@ -115,6 +115,9 @@ def download(self):
         if self.is_available():
             logger.warning("%s already available at %s", self.component, self.path)
 
+        if not system.path_exists(self.versions_path):
+            self.fetch_versions()
+
         url = self.get_download_url()
         if not url:
             logger.warning("Could not find a release for %s %s", self.component, self.version)


Test patch: