Repository: lutris/lutris

Issue:
Lutris is trowing some python errors when installing dot net for a wine prefix 
### Bug description

lutris is giving me some python errors when i try to install dotnet using winetricks 

after trying to solve it by myself on my main manjaro install i tried to run lutris on a vm to see if i was getting the same error and im getting the exact problem that i have on my main install 

the install crashes with a TypeError("winetricks() got an unexpected keyword argument 'return_code'") mesage 

### How to Reproduce

go to https://lutris.net/games/final-fantasy-xiv-online/ download the "XIVLauncher version" install script and then try to install the game

### Expected behavior

the script installs a couple of dependencys using winetricks before starting the main game install 

### Log output

```2022-03-29 19:46:46,146: Starting Lutris 0.5.9.1
2022-03-29 19:46:46,159: No cores found
2022-03-29 19:46:48,639: Startup complete
INFO     2022-03-29 19:46:48,640 [startup.check_driver:53]:Using NVIDIA drivers 510.54 for x86_64
INFO     2022-03-29 19:46:48,640 [startup.check_driver:57]:GPU: Unknown
INFO     2022-03-29 19:46:48,640 [startup.check_driver:73]:GPU: 10DE:1B80 1043:85AA (nvidia drivers)
ERROR    2022-03-29 19:46:48,640 [startup.check_libs:108]:i386 libgnutls.so.30 missing (needed by gnutls)
DEBUG    2022-03-29 19:46:48,953 [lutriswindow.update_store:451]:Showing 0 games
2022-03-29 19:46:58,305: Using NVIDIA drivers 510.54 for x86_64
2022-03-29 19:46:58,305: GPU: Unknown
2022-03-29 19:46:58,305: GPU: 10DE:1B80 1043:85AA (nvidia drivers)
2022-03-29 19:46:58,305: i386 libgnutls.so.30 missing (needed by gnutls)
2022-03-29 19:46:58,317: Fetching installer https://lutris.net/api/installers/final-fantasy-xiv-online-xivlauncher
2022-03-29 19:46:58,317: GET https://lutris.net/api/installers/final-fantasy-xiv-online-xivlauncher
2022-03-29 19:46:59,062: Showing window <class 'lutris.gui.installerwindow.InstallerWindow'>final-fantasy-xiv-online
2022-03-29 19:47:04,432: Retrieving video modes from XrandR
2022-03-29 19:47:06,080: Files are ready? True
2022-03-29 19:47:06,082: Creating destination path /home/sisco/Games/final-fantasy-xiv-online
2022-03-29 19:47:07,684: ⬇ https://kamori.goats.dev/Proxy/Update/Release/Setup.exe
2022-03-29 19:47:09,992: Finished downloading https://kamori.goats.dev/Proxy/Update/Release/Setup.exe
2022-03-29 19:47:10,188: Download completed
2022-03-29 19:47:10,188: launchersetup is available
2022-03-29 19:47:10,188: All files available
2022-03-29 19:47:10,188: All files are available, continuing install
2022-03-29 19:47:10,189: Installer command: {'task': {'arch': 'win64', 'install_gecko': False, 'install_mono': False, 'name': 'create_prefix', 'prefix': '$GAMEDIR'}}
2022-03-29 19:47:10,190: Creating a win64 prefix in /home/sisco/Games/final-fantasy-xiv-online
2022-03-29 19:47:10,190: Executing /home/sisco/.local/share/lutris/runners/wine/lutris-7.1-x86_64/bin/wineboot
2022-03-29 19:47:10,190: WINEARCH=win64 WINEPREFIX=/home/sisco/Games/final-fantasy-xiv-online WINEDLLOVERRIDES=mscoree,mshtml,winemenubuilder=
2022-03-29 19:47:16,930: win64 Prefix created in /home/sisco/Games/final-fantasy-xiv-online
2022-03-29 19:47:16,956: Installer command: {'task': {'arch': 'win64', 'key': 'background', 'name': 'set_regedit', 'path': 'HKEY_CURRENT_USER\\Control Panel\\Colors\\', 'prefix': '$GAMEDIR', 'type': 'REG_SZ', 'value': '0 0 0'}}
2022-03-29 19:47:16,957: Setting [HKEY_CURRENT_USER\Control Panel\Colors\]:background="0 0 0"
2022-03-29 19:47:16,962: /home/sisco/.local/share/lutris/runners/wine/lutris-7.1-x86_64/bin/wine64 is provided by Lutris, using runtime
2022-03-29 19:47:16,964: Executing /home/sisco/.local/share/lutris/runners/wine/lutris-7.1-x86_64/bin/wine64 regedit /S /home/sisco/.cache/lutris/winekeys.reg
2022-03-29 19:47:16,964: WINEARCH=win64 WINE=/home/sisco/.local/share/lutris/runners/wine/lutris-7.1-x86_64/bin/wine64 WINEPREFIX=/home/sisco/Games/final-fantasy-xiv-online LD_LIBRARY_PATH=/home/sisco/.local/share/lutris/runners/wine/lutris-7.1-x86_64/lib:/home/sisco/.local/share/lutris/runners/wine/lutris-7.1-x86_64/lib64:/usr/lib:/usr/lib32:/usr/lib/libfakeroot:/usr/lib64:/home/sisco/.local/share/lutris/runtime/Ubuntu-18.04-i686:/home/sisco/.local/share/lutris/runtime/steam/i386/lib/i386-linux-gnu:/home/sisco/.local/share/lutris/runtime/steam/i386/lib:/home/sisco/.local/share/lutris/runtime/steam/i386/usr/lib/i386-linux-gnu:/home/sisco/.local/share/lutris/runtime/steam/i386/usr/lib:/home/sisco/.local/share/lutris/runtime/Ubuntu-18.04-x86_64:/home/sisco/.local/share/lutris/runtime/steam/amd64/lib/x86_64-linux-gnu:/home/sisco/.local/share/lutris/runtime/steam/amd64/lib:/home/sisco/.local/share/lutris/runtime/steam/amd64/usr/lib/x86_64-linux-gnu:/home/sisco/.local/share/lutris/runtime/steam/amd64/usr/lib
2022-03-29 19:47:17,226: Installer command: {'task': {'app': 'dotnet48 vcrun2019 win10', 'name': 'winetricks', 'prefix': '$GAMEDIR', 'return_code': 256}}
2022-03-29 19:47:17,227: Error while completing task <bound method CommandsMixin.task of <interpreter.ScriptInterpreter object at 0x7fef58b745c0 (lutris+installer+interpreter+ScriptInterpreter at 0x55a0e0f3ec00)>>: <class 'TypeError'> winetricks() got an unexpected keyword argument 'return_code'
  File "/usr/lib/python3.10/site-packages/lutris/util/jobs.py", line 34, in target
    result = self.function(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/lutris/installer/commands.py", line 407, in task
    command = task(**data)

```


### System Information

```shell
[System]
OS:              Manjaro Linux 21.2.5 Qonos
Arch:            x86_64
Kernel:          5.15.28-1-MANJARO
Desktop:         KDE
Display Server:  x11

[CPU]
Vendor:          AuthenticAMD
Model:           AMD Ryzen 7 5800X 8-Core Processor
Physical cores:  8
Logical cores:   16

[Memory]
RAM:             15.6 GB
Swap:            2.4 GB

[Graphics]
Vendor:          NVIDIA Corporation
OpenGL Renderer: NVIDIA GeForce GTX 1080/PCIe/SSE2
OpenGL Version:  4.6.0 NVIDIA 510.54
OpenGL Core:     4.6.0 NVIDIA 510.54
OpenGL ES:       OpenGL ES 3.2 NVIDIA 510.54
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:
I have the same issue, with the same script even
Likewise. Same script, same error.

Resolving patch:
diff --git a/lutris/installer/commands.py b/lutris/installer/commands.py
--- a/lutris/installer/commands.py
+++ b/lutris/installer/commands.py
@@ -447,7 +447,7 @@ def task(self, data):
     def _monitor_task(self, command):
         if not command.is_running:
             logger.debug("Return code: %s", command.return_code)
-            if command.return_code not in (command.accepted_return_code, "0"):
+            if command.return_code not in (str(command.accepted_return_code), "0"):
                 raise ScriptingError(_("Command exited with code %s") % command.return_code)
             self._iter_commands()
             return False


Test patch: