LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-04-2014, 01:32 PM   #1
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Installing more than one version of Wine


What's the easiest way to install more than one version of Wine? I might want to have both the stable and development versions installed at the same time.

This will be on a 64-bit multilib system.

Is there a better way than installing one via the SBo SlackBuild as is, then hacking the SlackBuild to install the other one into /opt and not into /usr, then writing a launcher for the one in /opt that will set the necessary environment variables?

http://wiki.winehq.org/FAQ#head-5d2f...0d1259e67c465f

Last edited by dugan; 11-04-2014 at 02:09 PM.
 
Old 11-04-2014, 08:52 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,978

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Guess you could build it static where all depends are in the glob.

There is a way to set environment at boot to choice as in mounting mount points over others.

Might be kind of hard to take a standard boot and standard installer both to same place and then choose.
 
Old 11-04-2014, 09:28 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Depends a lot on how you want to actually use it, how many versions and how often you might want to introduce a new one or remove an old one.

Looking at the package list from wine-1.6.1 (32 bit), the include, share, doc and lib install paths are pretty much self-contained in .../wine/ subdirectories and would be easy to switch using symlinks. The bin and man paths would take a little more thought with 20+ files each, but might be easily enough built to a new path that could be version-symlinked and switched around.

Until recently (when the mobo died on that system) I ran a similar arrangement for switching MySQL versions and ran 3.23, 4.x and 5.x - six different versions at one point, without major problems. I scripted the switch to safely start and stop running instances, change a few symlinks and my.cnf versions, and of course each had its own data path.

That worked well and was easy to manage so long as I was careful when adding new versions.

My MySQL arrangement pre-dated my git experience but when I resurrect that one I intend to try to reproduce that within a git repo such that switching branches would switch running version... might be worth some thought for your case as well.

Of course you can only run one version at a time this way - I can't think of any easy way to run more than one, or why you would want to...

And with wine you might need to be careful about version sensitivity of the registry files - I am not sure how those might be affected.
 
Old 11-05-2014, 12:25 AM   #4
moesasji
Member
 
Registered: May 2008
Distribution: Slackware Current / OpenBSD
Posts: 322

Rep: Reputation: 104Reputation: 104
Quote:
Originally Posted by dugan View Post
What's the easiest way to install more than one version of Wine? I might want to have both the stable and development versions installed at the same time.
PlayOnLinux allows to run and install multiple versions of Wine in a rather easy way and works fine for me on a multilib 64bit system. It might be worth looking at either using this or else look how they solved this.
 
Old 11-05-2014, 02:27 AM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Original Poster
Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
I've yet to try PlayOnLinux, but I did look into how it works. When you install a version of Wine from the PlayOnLinux UI, it downloads downloads a prebuilt Wine tarball from the PlayOnLinux server and then extracts it into a place where PlayOnLinux can find it. The 32-bit Wine packages available to it are here. Each .pol file is a tarball:

http://www.playonlinux.com/wine/binaries/linux-x86/

PlayOnLinux is an option. What I had in mind, however, was installing both the latest stable and latest experimental versions of Wine, choosing one or the other for each application, and using Winetricks to install each application into its own prefix.

Anyway, I just patched the SBo Wine SlackBuild to build Wine 1.7, install it into /opt, and package it into a package named "wine17". That coexists well with the normal Wine SlackBuild, which installs into /usr and makes a package called "wine".

Last edited by dugan; 11-05-2014 at 02:31 AM.
 
Old 11-05-2014, 03:02 AM   #6
mcnalu
Member
 
Registered: Dec 2006
Location: Glasgow, UK
Distribution: Slackware current
Posts: 423

Rep: Reputation: 73
Installing more than one version of Wine

You may get some clues from looking at AlienBob's wine-pipelight package. Amongst other things, it uses .wine-pipelight for user configuration files rather than .wine. Also if a wine process is running that may well be the one that gets used and that may not be the wine you want to use. I hit some issue like that with pipelight but I don't fully understand it yet.
 
Old 11-05-2014, 10:36 AM   #7
garpu
Senior Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 1,535

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
If you want the development release and the stable one, I'd just go with the development release. In my experience, the "stable" WINE release is usually out of date and not as good as the development one. Unless you need a specific version of WINE, I'd go with whatever's current.
 
Old 11-05-2014, 04:24 PM   #8
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
Quote:
Originally Posted by garpu View Post
If you want the development release and the stable one, I'd just go with the development release. In my experience, the "stable" WINE release is usually out of date and not as good as the development one. Unless you need a specific version of WINE, I'd go with whatever's current.
Careful! Many games are also "out of date" and prefer earlier versions of wine. Seriously, don't get caught up in this "new always == improved" nonsense. It is oversimplification and completely disregards the converse "tried and true". A blend, arrived at from careful consideration, is most useful and reliable. Rushing headlong in a straight line quite commonly involves colliding with dense obstacles.
 
1 members found this post helpful.
Old 11-05-2014, 10:17 PM   #9
kingbeowulf
Senior Member
 
Registered: Oct 2003
Location: WA
Distribution: Slackware
Posts: 1,266
Blog Entries: 11

Rep: Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744
Dugan

Maybe take a look at how TeamViewer bundles WINE with the windows version to create a standalone program bundle? Their Linux version program wraps a custom Wine install ans some scripts around the Windows executable. https://www.teamviewer.com/en/download/linux.aspx

Then there is Winebottler for Mac OS X which can make a standalone distributable program bundle http://winebottler.kronenberg.org/

I've picked at this a bit but never really got anything working...and now that more Linux native games are coming out... It would still be nice to create standalone packages for some of my classic old windows games, using the best WINE version for each...
 
Old 11-06-2014, 09:18 AM   #10
schmatzler
Member
 
Registered: Jan 2011
Location: Germany
Distribution: Slackware64 -current + Multilib
Posts: 411

Rep: Reputation: 181Reputation: 181
Quote:
Originally Posted by enorbet View Post
Careful! Many games are also "out of date" and prefer earlier versions of wine.
I'm very active at the application database and that happens very rarely. Sometimes a regression occurs, for example: In Wine 1.7.29 textures in some games were garbled. This was fixed very fast in 1.7.30.
But for the majority of applications a new wine release doesn't change anything (if they already run).
The performance may even get better.

I build the new release every two weeks and test some of the games from my 250 games steam list. Most of them run, some of them need DLL's or a winetricks command, but they run.

The situation with lithtech engine games (No One Lives Forever, TRON, Blood II) has drastically improved in the last few versions, just to name an example. A year ago, they had whacky mouse problems, music wasn't running and overall they ran very unstable. Now I can play them with better performance than on Windows. :-)

If an application breaks after a specific release, the wine maintainers are very eager to fix this problem.

Edit: I have to clarify that I use wine mostly for games, for making music with OpenMPT and occasional 3D design with Cinema 4D. The situation may be different for other applications.

Last edited by schmatzler; 11-06-2014 at 09:40 AM.
 
1 members found this post helpful.
Old 11-10-2014, 06:59 AM   #11
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
Thank you, Schmatzler, that was interesting and informative. I have a question regarding multiple instances/versions and a link to demonstrate one issue that I'd be pleased to know was no longer required. Understand that as the article states this is with PoL and he says any data of experience in wineapps.db that mentions PoL is trashed so I don't know how objective you can be, but I'm willing to give you equal respect until I have reason to not for either.

In this page http://www.gamersonlinux.com/forum/t...mes-guide.142/ the author uses 2 (albeit both a little older) versions of Wine in order to grab.... well here's a quote -

Quote:
Originally Posted by gamersonlinux
Initially these libraries are standard for most games. Some games like Magicka require dotnet libraries and XNA libraries, but before you install these, make sure to switch your wine version to 1.5.18 and then switch it back to 1.6.2

dotnet11
dotnet11sp1
dotnet30 (automatically installs dotnet20)
dotnet35
dotnet4
xna31 (some game like Magicka need XNA)
xna40
Internet Explorer 8 (automatically installs Service Pack 3
IIRC there is also included a workaround to get DX versions newer than 9.0c. Several months ago I Steam-installed Deus Ex: Human Revolution which is a DX11 game. I can't recall how I got this to work but it does very well and largely thanks to wineapps.db to which I contributed on the forums.

So my question(s) is - What is currently recommended to solve the dotnet and DX issues?

Last edited by enorbet; 11-10-2014 at 07:03 AM.
 
Old 11-10-2014, 12:53 PM   #12
schmatzler
Member
 
Registered: Jan 2011
Location: Germany
Distribution: Slackware64 -current + Multilib
Posts: 411

Rep: Reputation: 181Reputation: 181
Quote:
Originally Posted by enorbet View Post
So my question(s) is - What is currently recommended to solve the dotnet and DX issues?
I don't know which "issues" you are referring to. All dotnet versions can be installed via winetricks. There is no need to downgrade your wine version for this.

According to the application database, you don't need all that stuff for Magicka. You just need dotnet35 and xna:
https://appdb.winehq.org/objectManag...estingId=80817

I highly recommend to ignore any advices to install the original Internet Explorer. Wine comes with its own implementation of the iexplore.exe that uses Mozillas Gecko engine for rendering. Installing iexplore overwrites a lot of system files that may break wine and applications in the process.

I'm also not very fond of PlayOnLinux. It uses unofficial patches, bundles outdated wine versions and overall makes it very hard to report bugs to the original project. Use the latest wine version and if you encounter any bugs with specific applications, search for help in the wine forums or file a bug.

Quote:
IIRC there is also included a workaround to get DX versions newer than 9.0c.
No. DX11 is not supported yet (DX10 partially, see this). You can copy over the DX11 files, but it won't work. Deus Ex: Human Revolution uses DirectX9 as a fallback which makes it work.

Last edited by schmatzler; 11-10-2014 at 12:55 PM.
 
1 members found this post helpful.
Old 11-11-2014, 05:30 PM   #13
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Original Poster
Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
I knocked up a simple environment management system to manage Wine bottles. It uses some code from VirtualEnv.

The following is named mkopener and needs to be a) executable and b) in your PATH:

Code:
#!/usr/bin/env python

import argparse
import os
import sys


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('bottle', help='The name of the Wine bottle, e.g. PvZ')
    parser.add_argument(
        '--wine', help='The path to the Wine executable to use'
    )
    args = parser.parse_args()

    set_wine = ''
    unset_wine = ''

    if args.wine is not None:
        if not os.path.isfile(args.wine):
            print 'Wine must be the path to an executable'
            sys.exit(1)

        set_wine = set_wine_template.format(path=os.path.dirname(args.wine))
        unset_wine = unset_wine_template

    print template.format(
        bottle=args.bottle, set_wine=set_wine, unset_wine=unset_wine
    )

template = """# This file must be used with "source bin/uncork" *from bash*
# you cannot run it directly

cork () {{

    # reset old environment variables

    unset WINEPREFIX

    # This should detect bash and zsh, which have a hash command that must
    # be called to get it to forget past commands.  Without forgetting
    # past commands the $PATH changes we made may not be respected
    if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
        hash -r 2>/dev/null
    fi

    if [ -n "$_OLD_BOTTLE_PS1" ] ; then
        PS1="$_OLD_BOTTLE_PS1"
        export PS1
        unset _OLD_BOTTLE_PS1
    fi

{unset_wine}

    if [ ! "$1" = "nondestructive" ] ; then
        # Self destruct!
        unset -f cork
    fi
}}

# unset irrelevant variables
cork nondestructive

_OLD_BOTTLE_PS1="$PS1"
PS1="({bottle})$PS1"
export PS1

WINEPREFIX=$HOME/.local/share/wineprefixes/{bottle}
export WINEPREFIX

{set_wine}

# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands.  Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
    hash -r 2>/dev/null
fi"""

set_wine_template = """_OLD_PATH="$PATH"
PATH={path}:$PATH
export PATH"""

unset_wine_template = """   if [ -n "$_OLD_PATH" ] ; then
        PATH="$_OLD_PATH"
        export PATH
        unset _OLD_PATH
    fi
"""


if __name__ == '__main__':
    main()
The second script needs to be sourced, so it can be put anywhere (as long as you're sourcing it). I called it bottle.sh:

Code:
function mkbottle {

	case $# in
	1)
		mkdir -p $HOME/.local/share/wineprefixes/$1/bin
		mkopener $1 > $HOME/.local/share/wineprefixes/$1/bin/uncork
		source $HOME/.local/share/wineprefixes/$1/bin/uncork
		cd $HOME/.local/share/wineprefixes/$1
		;;

	2)
		if [ -x $2 ]; then
			mkdir -p $HOME/.local/share/wineprefixes/$1/bin
			mkopener --wine $2 $1 > $HOME/.local/share/wineprefixes/$1/bin/uncork
			source $HOME/.local/share/wineprefixes/$1/bin/uncork
			cd $HOME/.local/share/wineprefixes/$1
		else
			echo /path/to/wine must be the path to a Wine execuable
		fi
		;;
	*)
		echo mkbottle BottleName \[/path/to/wine\]
		echo e.g. mkbottle PvZ
		echo e.g. mkbottle PvZ ~/Software/wine-1.7.30/bin/wine
		;;

	esac
}


function bottle {

	case $# in
	1)
		if [ -f $HOME/.local/share/wineprefixes/$1/bin/uncork ]; then
			source $HOME/.local/share/wineprefixes/$1/bin/uncork
			cd $HOME/.local/share/wineprefixes/$1
		else
			echo Invalid prefix
		fi
		;;
	*)
		echo bottle BottleName
		echo e.g. bottle PvZ
		;;

	esac
}
Now here's a demonstration. I have Wine 1.6.2 installed using the SBo SlackBuild. I also have Wine 1.7.30 installed like this:

Code:
mkdir -p ~/Software/wine-1.7.30
./configure --prefix=~/Software/wine-1.7.30
make
make install
After sourcing bottler.sh, you have the following commands:

mkbottle creates a Wine bottle (bottle and prefix mean the same thing). It takes the name of the bottle, and optionally the path to the Wine executable you want to use. Creating the bottle will automatically put you inside it, setting your WINEPREFIX and, if necessary, PATH environments appropriately.

cork will take you out of the Wine bottle and restore your environment to normal.

bottle will set your environment to that of an existing Wine bottle.

Perhaps the following transcript will help. Note that the prompt changes to show which bottle you're in:

Code:
dugan@slackware [03:19:06] [~] 
-> % mkbottle PvZ ~/Software/wine-1.7.30/bin/wine
(PvZ)dugan@slackware [03:19:33] [~/.local/share/wineprefixes/PvZ] 
-> % echo $WINEPREFIX
/home/dugan/.local/share/wineprefixes/PvZ
(PvZ)dugan@slackware [03:19:37] [~/.local/share/wineprefixes/PvZ] 
-> % echo $PATH
/home/dugan/Software/wine-1.7.30/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin
(PvZ)dugan@slackware [03:19:39] [~/.local/share/wineprefixes/PvZ] 
-> % wine --version
wine-1.7.30
(PvZ)dugan@slackware [03:19:49] [~/.local/share/wineprefixes/PvZ] 
-> % cork  
dugan@slackware [03:19:57] [~/.local/share/wineprefixes/PvZ] 
-> % echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin
dugan@slackware [03:20:07] [~/.local/share/wineprefixes/PvZ] 
-> % echo $WINEPREFIX

dugan@slackware [03:20:44] [~/.local/share/wineprefixes/PvZ] 
-> % wine --version
wine-1.6.2
dugan@slackware [03:20:52] [~/.local/share/wineprefixes/PvZ] 
-> % bottle PvZ
(PvZ)dugan@slackware [03:20:58] [~/.local/share/wineprefixes/PvZ] 
-> % echo $WINEPREFIX
/home/dugan/.local/share/wineprefixes/PvZ
(PvZ)dugan@slackware [03:21:05] [~/.local/share/wineprefixes/PvZ] 
-> % echo $PATH
/home/dugan/Software/wine-1.7.30/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/usr/lib64/qt/bin:/usr/share/texmf/bin
(PvZ)dugan@slackware [03:21:09] [~/.local/share/wineprefixes/PvZ] 
-> % wine --version
wine-1.7.30
(PvZ)dugan@slackware [03:21:14] [~/.local/share/wineprefixes/PvZ] 
-> % cork
dugan@slackware [03:21:18] [~/.local/share/wineprefixes/PvZ] 
-> %
If Plants vs Zombies requires special settings (it doesn't, but bear with me), you can create a prefix just for it, use Winetricks to install Steam into it, and then tweak it in its own isolated bottle without affecting your other applications:

Code:
mkbottle PvZ /path/to/executable/of/wine
winetricks --no-isolate steam
Note the use of the --no-isolate flag to get Winetricks to install Steam into the PvZ prefix.

Last edited by dugan; 11-11-2014 at 06:50 PM.
 
2 members found this post helpful.
Old 11-25-2014, 01:20 AM   #14
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,222

Original Poster
Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
How long has it been since I posted that? Two weeks? That's how long I've spent reworking it into a complete system for managing your installations of Wine and of Wine software. I'm happy to be able to announce it now. The README should tell you the rest. Have a look:

https://github.com/duganchen/wine_env

And of course I created a Slackware packaging script. It will check out the sources from GitHub, build and package them:

Code:
#!/usr/bin/env bash

set -e

TMP=${TMP:-/tmp}
PRGNAM=wine_env
PKG=$TMP/package-$PRGNAM
BUILD=1dc

rm -rf $PKG
rm -rf $TMP/$PRGNAM

mkdir -p $PKG
cd $TMP
git clone https://github.com/duganchen/${PRGNAM}.git
cd $PRGNAM

VERSION=`git rev-parse --short HEAD`

chown -R root:root .
find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

python setup.py install --root=$PKG

find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

cd $PKG
/sbin/makepkg -l y -c n $TMP/$PRGNAM-$VERSION-noarch-${BUILD}.txz
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Yum is installing an old version of subversion -- how can I get the latest version? dhjdhj Linux - Newbie 6 06-18-2009 01:34 AM
Installing old wine version with apt-get/synaptic on Ubuntu 8.04 ErV Ubuntu 2 10-09-2008 02:15 PM
Problems installing WINE on Fedora Core 6 using $yum install wine rubiks_nerd_90 Linux - Software 4 03-06-2008 08:36 AM
Deus Ex -- Wine 0.9.33 -- Revert to older version of Wine? MathBluster Linux - Games 0 07-13-2007 08:34 PM
wine: installing win apps. using wine on mandrake10 dexmax Linux - Newbie 2 09-05-2005 04:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration