Need to redirect Wine output

I wanted to make a runner for the tool. There is actually one already in Lutris DB, but it does not work. There is a peculiar quirk with a tool.

When using simple Wine to run it, running as wine application.exe, it stucks infinitely on a boot screen. If the command is wine application.exe &>/dev/null it launches and works normally. Simply discarding the output from Wine solves the problem. This situation has been going on for the last 5 years, so there is little hope in waiting for patches. (Turning off output with WINEDEBUG=-all does not solve the problem)

The problem is: how to add redirection to Lutris configs? Adding it arguments does not work, obviously, because they are escaped. I need to tweak something outside the GUI, but I don’t know what. Another alternative woulds be to make a launcher script, but whenever I try to run Wine from the runner in script, it does not apply all settings and tweaks from the GUI.

Any suggestions please?

The simplest way is probably to create a wrapper script (with contents similar to /usr/bin/wine "$@" &>1) and supply it as the custom Wine executable.

Yes, that is what I am doing. But is there a way to get the path to Lutris’s configured Wine in such a script? /usr/bin/Wine would call system Wine.

Lutris wine binaries are under ~/.local/share/lutris/runners/wine/${wine_version}/bin/wine, so you could put in your script:

"${HOME}/.local/share/lutris/runners/wine/${1}/bin/wine" "$@" &>1

and then pass the wine version you want to use in Lutris as an argument (e.g. staging-2.21-x86_64). Yeah, that means you can’t change it from the dropdown menu, but you can still change it on the fly.

Something I do in cases like this is make a script that uses a relative path (./wine) and symlink it into the directory of the wine version I intend to use it with.
More specifically, last time I did it I named it wine+ and Wine call was "${0%+}" so that path to the binary was based on the symlink location rather than workdir.