How set WoW64 wine with both wine64 and wine in prefix/bin

Questions about Wine on Linux
Locked
zhou380491943
Newbie
Newbie
Posts: 2
Joined: Fri Jan 30, 2015 7:22 am

How set WoW64 wine with both wine64 and wine in prefix/bin

Post by zhou380491943 »

Hollo everyone:
I have tried to build Wow64 wine 1.7 on Ubuntu 14.04 according to http://wiki.winehq.org/BuildingBiarchWineOnUbuntu ,and I add --prefix=/opt following ./configure whenever building wine64 outside of linux container or building wine32 in the linux container. Of course ,I have to set the enviroment variables and find how to do that in the FAQ:2.3
[export WINEVERPATH=$W
export PATH=$W/bin:$PATH
export WINESERVER=$W/bin/wineserver
export WINELOADER=$W/bin/wine
export WINEDLLPATH=$W/lib/wine/fakedlls
export LD_LIBRARY_PATH="$W/lib:$LD_LIBRARY_PATH" ]
However, there are both wine and wine64 exectable program at /opt/bin and the wine64 --help also show me :"wine program [arguments] " .Are wine and wine64 is same command?....How to deal with this?
What's more , actually I don't know how to use wine ,because in Linux container only 32-bit,but if out of Container,only 64-bit,could that be the same time?
Thank you very much for your help!
User avatar
olivierfrdierick
Level 5
Level 5
Posts: 258
Joined: Thu Sep 13, 2012 12:09 pm

Re: How set WoW64 wine with both wine64 and wine in prefix/b

Post by olivierfrdierick »

wine64 is 64bit wine.
wine is 32bit wine.
You can check with "file wine" and "file wine64"
One should be "ELF 32-bit ..." and the other "ELF 64-bit ..."

About "wine program [arguments]": This is only a static text. It does not reflect the actual file name.
Replace wine with wine64 in your commands when you want to use 64bit Wine.

64bit linux can run 32bit programs. So, yes you can run both wine 32bit and wine 64bit outside the container.
They may even be run at the same time, but they'll be separate instances and must NOT use the same wine prefixes.
32bit prefixes are for 32bit programs and should only be used with 32bit wine.
64bit prefixes are for 64bit programs and should only be used with 64bit wine.

The container is only used to compile Wine.
After that you don't need the container anymore and you can delete it (or keep it to comiple the next Wine version).
zhou380491943
Newbie
Newbie
Posts: 2
Joined: Fri Jan 30, 2015 7:22 am

Re: How set WoW64 wine with both wine64 and wine in prefix/b

Post by zhou380491943 »

Thank you very much!Mr.olivierfrdierick!That's true!
I hope you would not mind my next two question! Question:
First:There is a environment virable WINEARCH=win32/win64, and the command “WINEARCH=win64 wine **.exe” is the same as the command" wine64 ***.exe"??
Second:I always use the command "WINEPREFIX=***path/to/prefix WINEARCH=win32/win64 winecfg" to build the prefix,and the WINEARCH=win64 will have another file called Program File(x86) in C:,dose WINEARCH=win64/win32 just means different method to arrange directories and can I install the win32setup.exe or win64setup.exe in both WINEARCH directories?If I am right above,then how to install win32setup.exe in WINEARCH=win64 prefix,does use the command "WINEPREFIX=/path/to/prefix WINEARCH=win64 wine 32setup.exe?
Thank you for your help ,dear Mr.olivierfrdierick!
User avatar
olivierfrdierick
Level 5
Level 5
Posts: 258
Joined: Thu Sep 13, 2012 12:09 pm

Re: How set WoW64 wine with both wine64 and wine in prefix/b

Post by olivierfrdierick »

The WINEARCH variable must be used when creating the wineprefix, because once the wineprefix is created it cannot be changed.
You cannot switch between WINEARCH=wine32 and WINEARCH=wine64 for the same wineprefix in different commands.
There is more to it than just a different directory structure. I don't know the details but at least the Windows registry is different too.

Here is a summary of what you can do:
  • Running a 32bit program in a 32bit environment with 32bit Wine

Code: Select all

$ WINEPREFIX=./wine32/whatever WINEARCH=wine32 winecfg
WINEPREFIX=./wine32/whatever wine 32bitprog.exe
Wine will have 32bit limitations.
WINEARCH=wine32 is optional with wine commands.
  • Running a 32bit program in a 32bit environment with 64bit Wine

Code: Select all

$ WINEPREFIX=./wine32/whatever WINEARCH=wine32 winecfg
WINEPREFIX=./wine32/whatever WINEARCH=wine32 wine64 32bitprog.exe
Wine will use 64bit features.
I don't know how wine64 handles 32bit wineprefix when unspecified, so I use WINEARCH=wine32 to be sure.
  • Running a 32bit program in a 64bit environment with 64bit Wine

Code: Select all

$ WINEPREFIX=./wine64/whatever WINEARCH=wine64 winecfg
WINEPREFIX=./wine64/whatever wine64 32bitprog.exe
Wine will use 64bit features.
WINEARCH=wine64 is optional for wine64 when the wineprefix is 64bit.
  • Running a 64bit program in a 64bit environment with 64bit Wine

Code: Select all

$ WINEPREFIX=./wine64/whatever WINEARCH=wine64 winecfg
WINEPREFIX=./wine64/whatever wine64 64bitprog.exe
WINEARCH=wine64 is optional for wine64 when the wineprefix is 64bit.
  • This will NOT work

Code: Select all

$ WINEPREFIX=./wine64/whatever WINEARCH=wine64 winecfg
WINEPREFIX=./wine64/whatever WINEARCH=wine64 wine 64or32bitprog.exe
This doesn't work because 32bit wine cannot use a 64bit wineprefix (even for a 32bit program).

Note: In the code above the first command creates the wineprefix.
This needs only to be done once for each wineprefix.
After that you may run as many command as you want from that wineprefix.

Edit: If you have to run both 32bit and 64bit programs at the same time in the same environment, you have to use a 64bit prefix.
For example, let's say that you have a 32bit teamspeak-like background program that you can activate from inside a 64bit game, you may launch both programs in the same 64bit Wine instance:

Code: Select all

$ WINEPREFIX=./wine64/whatever wine64 32bitprog.exe &
$ WINEPREFIX=./wine64/whatever wine64 64bitprog.exe
(untested)

Edit2: You don't have to worry where a 32bit or 64bit program will install itself to. The installer will chose the appropriate Program Files directory. So in your case running win32setup or win64setup depends on whether you want to install the 32bit or 64bit version of your program. I don't think it is possible to install both versions of the same program at the same time (in the same wineprefix, that is). To install the 32bit version you'll have to do like I wrote in Running a 32bit program in a 64bit environment with 64bit Wine above.

Link: 3.5.8 - WINEARCH
User avatar
dimesio
Moderator
Moderator
Posts: 13207
Joined: Tue Mar 25, 2008 10:30 pm

Re: How set WoW64 wine with both wine64 and wine in prefix/b

Post by dimesio »

The WINEARCH variables are win32/win64, not wine32/wine64. WINEARCH only needs to be specified on prefix creation.
User avatar
olivierfrdierick
Level 5
Level 5
Posts: 258
Joined: Thu Sep 13, 2012 12:09 pm

Re: How set WoW64 wine with both wine64 and wine in prefix/b

Post by olivierfrdierick »

Oops, I wish I could edit my post. x)
Locked