Wine script

Questions about Wine on Linux
Locked
Cybermax
Level 4
Level 4
Posts: 218
Joined: Fri Dec 01, 2017 5:26 pm

Wine script

Post by Cybermax »

This is probably nothing "new", as im pretty sure there are snippits and scripts up the creek all over this forum, but info might still get lost. So, here is my script for starting "Unigine Valley" with my self-compiled wine version and what i have done to get there :)

I run the "configure" command when building wine by adding: --prefix="$HOME/wine/wine-staging-2.18" (Following the wiki) to build wine-staging-2.18 from source
This will put all the binaries in the $HOME/wine/wine-staging-2.18 folder.

I then set up my prefix with:

Code: Select all

WINEPREFIX="$HOME/Unigine" $HOME/wine/wine-staging-2.18/bin/wine
This will create the folder "Unigine" in my $HOME folder

Install Unigine Valley in the wineprefix (or whatever program you want, this is just an example)

I have created a /bin folder under my $HOME folder, that is in the env path, and i add the following script "valley" there:

Code: Select all

export userwine='/home/yourusername/wine/wine-staging-2.18/bin/wine' "$@"
export WINEPREFIX="$HOME/Unigine"
export WINEDEBUG="-all"
export __GL_SYNC_TO_VBLANK=0
export STAGING_SHARED_MEMORY=1
export STAGING_WRITECOPY=1
export PULSE_LATENCY_MSEC=30
cd "$HOME/Unigine/drive_c/Program Files (x86)/Unigine/Valley Benchmark 1.0/bin"
$userwine ./browser_x86.exe -config ../data/launcher/launcher.xml
(Replace "yourusername" with your actual username or path to your $HOME folder)

Now, lets say you want to switch wine versions to wine-3.0, just do the same exept use --prefix="$HOME/wine/wine-3.1" on the configure lines when building wine, and change the first line in the script to :

Code: Select all

export userwine='/home/yourusername/wine/wine-3.1/bin/wine' "$@"
You can delete/add other "export" stuff in the file, eg. "export __GL_THREADED_OPTIMIZATIONS=1" if you have a nVidia graphics adapter and its not enabled by default.. stuff like that :)

Make the script executable with

Code: Select all

chmod u+x $HOME/bin/valley
and just run valley as a command.
I find this way a perfectly acceptable solution to running different stuff, as you could also make shortcuts to theese scripts on your distro's taskbars or whatever you want :)

Running winecfg:

Code: Select all

WINEPREFIX="$HOME/Unigine" $HOME/wine/wine-staging-2.18/bin/winecfg
Locked