Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Winetricks not finding wine after selecting a game #352

Open
J-Lamiroy opened this issue Oct 14, 2024 · 9 comments
Open

Winetricks not finding wine after selecting a game #352

J-Lamiroy opened this issue Oct 14, 2024 · 9 comments

Comments

@J-Lamiroy
Copy link

Describe the bug
After trying to select a game on the GUI, I recieve a winetricks error box displaying "WINE is /usr/bin/wine, which is neither on the path nor an executable file"

To Reproduce
Steps to reproduce the behavior:

  1. Run protontricks --gui
  2. Select a game
  3. Above winetricks error is displayed.

Expected behavior
The winetricks menu should open.

System (please complete the following information):

  • Distro: Ubuntu 24.04.1
  • Protontricks installation method: Flatpak
  • Protontricks version: 1.11.1
  • Steam version: steam_beta
@Matoking
Copy link
Owner

If you run env | grep WINE in your terminal, does it print anything?

I'm guessing you have set WINE somewhere (e.g. ~/.bashrc, ~/.profile), which is being inherited by the Flatpak process. The problem is that /usr/bin/wine does not exist inside the Flatpak sandbox and Protontricks/Winetricks can't find it.

@J-Lamiroy
Copy link
Author

I get this

~$ env | grep WINE
WINE=/usr/bin/wine
WINETRICKS=/usr/bin/winetricks

So it does seem it's just out of reach for Flatpak. How can I change it to something it can access?

@Matoking
Copy link
Owner

There's no need, unless you specifically need to run a specific version of Winetricks. The Protontricks Flatpak has a built-in Winetricks executable.

Otherwise, you could try installing Winetricks under your home directory somewhere. You might need to add a filesystem permission using Flatseal first, though.

@J-Lamiroy
Copy link
Author

Would you mind giving me a quick rundown on how to do this? I'm quite new to linux, and I'm not sure how to go about it.

@Matoking
Copy link
Owner

Matoking commented Oct 25, 2024

We'll probably want to remove those environment variables completely unless you set them yourself. Maybe you used a Wine or Proton related utility that added those environment variables?


You could try running the following command to open a Bash shell; this should print a lot of detailed startup information about the environment, including any environment variables such as WINE and WINETRICKS and where they are set:

bash --verbose -x

Search for WINE or WINETRICKS other in the output. It should be preceded by a file path that determines what file set that environment variable. For example, in the following example PS1 was set inside /etc/bash.bashrc:

❯ bash --verbose -x
#
# /etc/bash.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return
+ [[ himvxBH != *i* ]]

PS1='[\u@\h \W]\$ '
+ PS1='[\u@\h \W]\$ '

You can then open the file in a text editor and check for WINE=/usr/bin/wine or other similar lines you saw in the output. If you find any, could you report back where you found them? It would be useful to know what application is causing this, as this behavior can easily trip up Flatpak Protontricks installations and be a pain to diagnose, as I'm sure you've noticed. :)

@J-Lamiroy
Copy link
Author

Thanks for your reply! I ran the command, and found the variables here:

#Personal Wine and Winetricks envs for Protontricks
export WINE="/usr/bin/wine"
+ export WINE=/usr/bin/wine
+ WINE=/usr/bin/wine
export WINETRICKS="/usr/bin/winetricks"
+ export WINETRICKS=/usr/bin/winetricks
+ WINETRICKS=/usr/bin/winetricks
alias protontricks='flatpak run com.github.Matoking.protontricks'
+ alias 'protontricks=flatpak run com.github.Matoking.protontricks'
alias protontricks-launch='flatpak run --command=protontricks-launch com.github.Matoking.protontricks'
+ alias 'protontricks-launch=flatpak run --command=protontricks-launch com.github.Matoking.protontricks'

@Matoking
Copy link
Owner

Thanks for your reply! I ran the command, and found the variables here:

#Personal Wine and Winetricks envs for Protontricks
export WINE="/usr/bin/wine"
+ export WINE=/usr/bin/wine
+ WINE=/usr/bin/wine
export WINETRICKS="/usr/bin/winetricks"
+ export WINETRICKS=/usr/bin/winetricks
+ WINETRICKS=/usr/bin/winetricks
alias protontricks='flatpak run com.github.Matoking.protontricks'
+ alias 'protontricks=flatpak run com.github.Matoking.protontricks'
alias protontricks-launch='flatpak run --command=protontricks-launch com.github.Matoking.protontricks'
+ alias 'protontricks-launch=flatpak run --command=protontricks-launch com.github.Matoking.protontricks'

OK, it looks like those environment variables were added by hand?

The solution here would be to remove the WINE and WINETRICKS variables. Protontricks should discover Winetricks automatically as necessary. WINE environment variable for Protontricks is usually counter-productive since different games can use different versions of Proton (aka Wine). Using the system Wine for them might cause issues.

@J-Lamiroy
Copy link
Author

This is weird, I unset the variables with unset, which allowed protontricks to work. However, when I tried to open it again, the original bug occurred again.
I checked, and WINE and WINETRICKS seem to have been set again. I unset them, and protontricks ran normally, would you know why that would happen, and how to make the change stick?

@Matoking
Copy link
Owner

Matoking commented Nov 5, 2024

Maybe ~/.profile or ~/.bashrc whatever file that contains the declarations is being read again inside the Flatpak sandbox? I can reproduce this by setting something inside ~/.bashrc (eg. export FOO=1) and running FOO=2 flatpak run --command=bash com.github.Matoking.protontricks; the environment variable will reset to FOO=1 inside the sandbox.

Did you remove them entirely from the originating file, or did you use unset to temporarily remove them before running flatpak run?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants