Search code examples
linuxwinexfce

Making a winetricks launcher in XFCE with wineprefix


I'm trying to create a launcher (shortcut) for winetricks (among other things wine-related) in xfce with my specific prefix.

In "command" part I have tried putting the following:

WINEPREFIX=~/.wineGames winetricks

WINEPREFIX='$HOME/.wineGames' winetricks

WINEPREFIX="$HOME/.wineGames" winetricks

WINEPREFIX=/home/myusername/.wineGames winetricks

WINEPREFIX="/home/myusername/.wineGames" winetricks

Any of these ends with error (or variant of):

"Failed to execute command "WINEPREFIX=~/.wineGames winetricks". Failed to execute child process "WINEPREFIX=~/.wineGames" (No such file or directory)"

I have to note that the first command absolutely DOES work, and works correctly when launcher from terminal. What am I doing wrong?


Solution

  • I suspect from the error message that your desktop launcher is not passing the command to a shell, but simply splitting it into tokens and passing them to execlp() or similar. Since WINEPREFIX=~/.wineGames isn't an executable file, that fails.

    You probably need to launch a shell to process the command line, using a command that is some variant of this:

     sh -c "WINEPREFIX=~/.wineGames winetricks"
    

    Depending on the environment, you may also have to use a full path instead of ~