How do I use two different versions of wine on the same installation?

PlayOnLinuxInstall PlayOnLinux

You can use PlayOnLinux to install applications which run on different versions of wine. PlayOnLinux provides an option of installing some libraries as well along with installation of a program.

To mange different versions of wine, go to Tools > Manage Wine Versions

Wine_Versions

If you want to add your custom compiled version of Wine to this list, create new wine "version" in ~/.PlayOnLinux/wine/linux-amd64 or linux-x86 and copy your custom installation there.

While installing an application you have an option of installing it a new virtual drive, in which you can install a different version of wine.

Virtual_Drive

PlayOnLinux


See the FAQ of wine here telling you that.

You have to scroll to

2.6 Can I install more than one Wine version on my system?

Fixing environment variables you'll be able to get it.


I use several scripts but basically do this:
go to:
https://dl.winehq.org/wine-builds/ubuntu/
then further to
https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/binary-i386/
and
https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/binary-amd64/

download ex.:

wine-staging_4.21_bionic_amd64.deb
wine-staging_4.21_bionic_i386.deb
wine-staging-amd64_4.21_bionic_amd64.deb
wine-staging-i386_4.21_bionic_i386.deb

(can be staging or stable) On the page search type ex.: 4.21
now skip all packages containing: wine-devel-, winehq-, -dbg and -dev, as the above ones.

You can use the script at the end instead of doing these steps manually:

copy them all to a folder named ex.: wine4.21-bionic (if it was stable could be instead wine4.21stable-bionic)

Extract them all using the filemanager (is easier, I use nemo). Expand all the 4 folders to see simultaneously all the data.tar.xz, select all these 4 and do "extract here" (will be on the sub-folder).

Now rename 2 of the 4 folders at wine4.21-bionic/ to (just keep their ending folder name):
amd64
i386

Copy the subfolders opt and usr from the remaining folders (the extracted but not renamed ones), and paste into the renamed folders (you must opt to merge the folders now).

Cleanup/Trash everything else that is not needed.

In nemo there is open as root context menu option. So I use it to move that folder and apply root permissions to top folder and all enclosed files.

Before being able to run it:

you will need these environment set after that, (I keep them at a top folder: /WineVersions/) ex.:

export PATH="$PATH:/WineVersions/wine4.21-bionic/amd64/opt/wine-staging/bin:/WineVersions/wine4.21-bionic/i386/opt/wine-staging/bin"

export LD_LIBRARY_PATH=":/WineVersions/wine4.21-bionic/amd64/opt/wine-staging/lib:/WineVersions/wine4.21-bionic/i386/opt/wine-staging/lib:/usr/lib/x86_64-linux-gnu"

(this /usr/lib/x86_64-linux-gnu may not be necessary above (try w/o it first?), but I use it anyway)

now you should be able to ex.: wine64 explorer (after you create and env set a WINEPREFIX of course :))


If you prefer, you can use this helper script to extract and prepare the contents of the downloaded .deb packages winePrepare.sh.

#!/bin/bash

set -eu

grep "[#]help" $0

: ${strWorkPath:="/WineVersions/_NEW_DOWNLOADS_"} #help you can change this. This is a main/workfolder work flow, so you need at least a 2 depth folder, on the example the main is WineVersions and the workfolder is _NEW_DOWNLOADS_. Place the downloaded packages at the strWorkPath.
if [[ ! -d "$strWorkPath" ]];then
  echo "create this folder and chown it to your normal user (not root): $strWorkPath (but /WineVersions should be owner root)"
  exit 1
fi
cd "$strWorkPath";pwd

strType="$1" #help stable or staging
strVersion="$2" #help ex.: 4.1
strDistro="$3" #help ex.: bionic

astrFiles=(
  "wine-${strType}_${strVersion}~${strDistro}_amd64.deb"
  "wine-${strType}_${strVersion}_${strDistro}_amd64.deb"
  
  "wine-${strType}-amd64_${strVersion}~${strDistro}_amd64.deb"
  "wine-${strType}-amd64_${strVersion}_${strDistro}_amd64.deb"
  
  "wine-${strType}_${strVersion}~${strDistro}_i386.deb"
  "wine-${strType}_${strVersion}_${strDistro}_i386.deb"

  "wine-${strType}-i386_${strVersion}~${strDistro}_i386.deb"
  "wine-${strType}-i386_${strVersion}_${strDistro}_i386.deb"
)

strPath="wine${strVersion}${strType}-${strDistro}"
mkdir -vp "$strPath"
strPath="$(realpath "$strPath")"
ls -ld "$strPath"

for strFile in "${astrFiles[@]}";do
  cd "$strPath"
  pwd
  if ls -l "../$strFile";then
    echo
    
    mv -v "../$strFile" ./
    
    if [[ "$strFile" =~ .*amd64.* ]];then
      mkdir -vp amd64
      cd amd64
    else
      mkdir -vp i386
      cd i386
    fi
    
    ar x "../$strFile"
    xz -d data.tar.xz
    tar -xf data.tar
    
    trash -v data.tar control.tar.xz debian-binary
  else
    echo "a file with that name was not found, trying next one"
  fi
done

echo "#now run these commands:"
echo "(sudo chown -vR root:root $strPath; sudo mv -v \"`basename "$strPath"`/\" ../; cd ..;pwd; sudo ln -vsfT `basename "$strPath"` $strType)" # this will chown to root the new wine files, move the folder to main path, symlink that folder to strtype