How to check if my Wine prefix is 32 bit or 64 bit?

49,873

Solution 1

All you have to do is, Browse the PlayonLinux's Virtual Drives. Go to the WINEPREFIX/drive_c/ folder and look for Program Files folder.

If you only see the Program Files and no ProgramFiles(x86) Then you are using 32 bit Wine Prefix. If you see both then you are using 64 Bit Wine Prefix. Hope this helps !!

Solution 2

If you are using PlayOnLinux, you can check which version using the GUI - open PlayOnLinux, click 'Configure' on the relevant program, and look at the pane on the left:

Alternatively, you can do what winetricks does (in version 20140817, circa line 3600), which is check the wineprefix for the presence of the directory WINEPREFIX/drive_c/windows/syswow64, which should be found in 64bit windows/wineprefix, but not 32bit versions. This should work for ordinary wineprefixes and those under PlayOnLinux.

Solution 3

I needed something similar in a script so made this script based on @wilf's answer:

#!/bin/bash

## Wine can spam stderr
ERRLOG=/tmp/dllerrlog.log

WINESYSDIR=$( winepath -u c:\\windows\\system32 2> $ERRLOG )    
if [[ ${WINESYSDIR} == *"/system32" ]]; then
  echo "Prefix is 32 bit"
  # do 32 bit stuff here...
elif [[ ${WINESYSDIR} == *"/syswow64"* ]]; then
  echo "Prefix is 64 bit"
  # do 64 bit stuff here...
else
  echo "Unknown wine architecture"
fi

And here is some output:

$ ./winearch.sh 
Prefix is 64 bit

And on a 32 bit wine prefix I have:

$ WINEPREFIX=~/.wine32 ./winearch.sh 
Prefix is 32 bit

Solution 4


Thanks to @wilf's for 'WINEPREFIX/drive_c/windows/syswow64' (it works)..
but i have been editing the wine registry to find any entry that reveals
what winearch the system is using (win32 or win64), and i have found it in:

cat /root/.wine/system.reg | grep -m 1 '#arch' | cut -d '=' -f2

This command displays: win32 (32 bit) or win64 (64 bit)




Bellow its one example how to use this in scripting:

  #!/bin/sh
  HkLm=$(cat /root/.wine/system.reg | grep -m 1 '#arch' | cut -d '=' -f2) > /dev/null 2>&1 # winearch (regedit)
  if [ "$HkLm" = "win64" ]; then
    echo "[x] winearch config: $HkLm (64 bits)"
    echo "[i] Please run:$IPATH/bin/enable_x32bits_wine.sh"
    exit
  fi

Final notes: i have tested this on kali linux..
if WINEPREFIX=/root/.wine32 then cat command must contain that directory
to be able to read inside folder for regedit winearch settings.

Solution 5

You could install winetricks, and type this in the terminal:

 sudo apt-get install winetricks

and then run winetricks, and then you can see it in preference.

Share:
49,873
aaldilai
Author by

aaldilai

Updated on September 18, 2022

Comments

  • aaldilai
    aaldilai over 1 year

    I saw tons of threads explaining how to create a 32 bit prefix, but I want to check if the prefix I'm using is 32 bit or 64 bit. The reason I'm asking is that I'm using PlayOnLinux, and I've created a 32 bit virtual drive (for example X). Now when I open winetricks in the folder ~/.PlayOnLinux/wineprefix, wineprefix gives me the message

    You are using a 64-bit WINEPREFIX. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.

    But, when I opened wineprefix in ~/.PlayOnLinux/wineprefix/X, the message didn't appear.

    How can I check if the prefix is 32 vs 64 bit?

  • Organic Marble
    Organic Marble over 8 years
    When I run winetricks, there is no option for "preference".
  • Karl Morrison
    Karl Morrison about 8 years
    There is no preference.
  • Dessa Simpson
    Dessa Simpson over 6 years
    This is not true. I just had a situation where the prefix was generated without an x86 directory but it was 64-bit as is shown by the fact that it contained drive_c/windows/syswow64.
  • Olivier G
    Olivier G about 5 years
    You shouldn't run wine as root so maybe use ~/.wine instead of /root/.wine