Fun With Wine

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this

Fun With Wine

Postby red-e-made on Mon Oct 20, 2008 8:13 pm

Hey there!

This information might actually only be helpful to a very small number of people here, but I thought I would post this little discovery, for the handful of people who might benefit from it.

For those of you who use Wine, more than likely your Wine programs are somewhere in /.wine and appear in your MintMenu under the Wine category of Programs. However, just as it's possible to put Wine-run programs in any directory you please, you can also run the .exe files of these programs directly from your MintMenu under any category you like, with the use of the "winebrowser" command followed by the file path to the .exe file.

For example, let's say you have a Wine-run game in the directory /home/MintFan/Desktop/Games, and the file path that runs this game is /home/MintFan/Desktop/Games/Space_Battle/SP.exe. Normally, you would have to open this directory and click the .exe file (provided you have it already set to be opened with Wine Windows Program Loader) in order to run it. Well, you can spare yourself those clicks through the path to the .exe by doing the following:

1. System>Preferences>Main Menu>Games>New Item
2. Name it what you like (in this example, Space Battle)
3. Give it the command: winebrowser /home/MintFan/Desktop/Games/Space_Battle/SP.exe
4. And close

From this point on, you can now run the game in Wine straight from Games.

I realize this a little trick that saves you a couple clicks while still letting you keep Wine-run apps wherever you please, but for me, I don't like to have all my Wine apps crowded into a single directory in my Home folder, and I like having my apps wherever I want in MintMenu, instead of having those programs which use Wine segregated under the Wine subsetting.

Just a little thing to give you a bit more freedom in your day-to-day use. Cheers!
User avatar
red-e-made
Level 5
Level 5
 
Posts: 525
Joined: Sat Jul 14, 2007 11:31 am

Linux Mint is funded by ads and donations.
 

Re: Fun With Wine

Postby tkocou on Mon Jun 01, 2015 10:45 am

Let's take your great tutorial a bit farther. On 64 bit machines running the 64 bit version of Linux Mint, when you install wine, you get a 64 bit version. All fine and dandy, however, Windows games are generally 32 bit programs. So, is there a way to force wine to be natively 32 bit on a 64 bit Linux Mint? YES and here is how:

Start in your home directory.
Rename the default .wine directory:
Code: Select all
$ mv .wine .wine-64

Invoke the winecfg with an environment setting:
Code: Select all
$ WINEARCH=win32 winecfg

Verify the 32 bit setting with a quick check:
Code: Select all
$ head ~/.wine/system.reg

The arch line should read:
Code: Select all
#arch=win32


Now building on having the Windows programs in a different directory (as listed above), let's make a new default wine directory.
If not already existing, create a directory called 'wine32'
Code: Select all
$ mkdir wine32

Copy the contents of the newly created 32 bit .wine directory:
Code: Select all
$ cd .wine
$ cp -afv * ~/wine32
$ cd


Now let's tell wine to use this 32 bit environment:
Code: Select all
$ nano .bashrc

And add these lines:
Code: Select all
export WINEPREFIX="/home/<your user name>/wine32"  # <- WINEPREFIX must be an absolute path!
export WINEARCH=win32

And save it. Log out and log in. Check your settings with:
Code: Select all
$ printenv

And look for the WINEARCH & WINEPREFIX variables.

Have fun. If your program requires native DLLs, you can use winetricks (in the repository for Linux Mint):
Code: Select all
$ winetricks d3dx9


Update:
There are subtle differences between a shell invoked within a shell script and via a terminal window. What may work perfectly when invoked in a terminal window, may crash and burn when you attempt to automate the process via a shell script.

Here is my methodology for getting a shell script to function just like doing it by hand. It is not the only way to do this, but it works.
Code: Select all
#!/bin/dash
# Specified shell to use (above line)
# This shell script assumes that you are starting in your home directory
# Setup environment variables next 2 lines
export WINEPREFIX="/home/<your user name>/wine32"  # <--- WINEPREFIX must be an absolute path
export WINEARCH=win32
# now get to the target directory and then invoke the program under wine
# NOTE: spaces in the directory names must be escaped with a '\'
cd wine32/drive_c/Program\ Files/Stardock\ Games/Sins\ of\ a\ Solar\ Empire; wine Sins\ of\ a\ Solar\ Empire\ Entrenchment.exe
# Lastly, exit 'no errors'
exit 0
Last edited by tkocou on Sun Jun 07, 2015 4:22 pm, edited 1 time in total.
tkocou
Level 1
Level 1
 
Posts: 15
Joined: Mon Jul 30, 2012 6:25 pm

Re: Fun With Wine

Postby Flemur on Mon Jun 01, 2015 1:55 pm

Good info.

FWIW, I don't have to
export WINEPREFIX="~/wine32"
export WINEARCH=win32
for a 32 bit prefix.

Here's how to make a wine program act like a regular linux program.
FIle ~/bin/iview (executable) :
Code: Select all
 #!/bin/sh

QUICKPARLOCATION="c:\\pgms\\IrfanView\\i_view32.exe"
PARAM=`winepath -w "$*"`
wine "$QUICKPARLOCATION" "$PARAM" &
exit 0

(Programs are installed in C:\pgms rather than under "Program Files").

Then you can
File-manager(thunar,etc) -> rt-click on a file -> Open with -> iview
or
$ iview file.jpg
Mint 17.1/fluxbox/pulse-less - Debian 8/fluxbox/pulse-less - Ubuntu 15.04/fluxbox/pulse-less
Please edit your original post title to include [SOLVED] if/when it is solved!
User avatar
Flemur
Level 7
Level 7
 
Posts: 1793
Joined: Mon Aug 20, 2012 9:41 pm
Location: Desert

Re: Fun With Wine

Postby tkocou on Mon Jun 01, 2015 4:51 pm

That is good to know information. Thank you. The nice thing about making a copy of the .wine directory: as you explore various tactics to get a Windows program running under wine and mess up the wine configuration; to recover, all you have to do is delete the wine32 directory, remake the directory, copy over the .wine directory and start over with that program.
tkocou
Level 1
Level 1
 
Posts: 15
Joined: Mon Jul 30, 2012 6:25 pm

Re: Fun With Wine

Postby Pjotr on Tue Jun 02, 2015 6:39 am

Note that Wine, although a technological miracle, creates serious security risks.... Because it also allows Windows *malware* to run in your /home.

That's why from a security perspective, a dual boot (or a Virtual Machine) with Windows is the preferred solution, for those Windows applications that you still need. :)
Tip: 10 things to do after installing Linux Mint 17.2
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Everything can be cracked, nothing is entirely secure, so strive for as much nothing as possible....
User avatar
Pjotr
Level 9
Level 9
 
Posts: 2849
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)

Re: Fun With Wine

Postby tkocou on Sun Jun 07, 2015 4:08 pm

Pjotr wrote:Note that Wine, although a technological miracle, creates serious security risks.... Because it also allows Windows *malware* to run in your /home.

That's why from a security perspective, a dual boot (or a Virtual Machine) with Windows is the preferred solution, for those Windows applications that you still need. :)

Thank you for the advise. Nobody would dispute the security risks involved with using any Windows based program. The ideas presented in this tutorial is intended for the occasional Game or Utility program and certainly not to replace Linux Mint. I have older Windows based games which will never have a native Linux version. So I use DOSBox and wine to runs these programs.
tkocou
Level 1
Level 1
 
Posts: 15
Joined: Mon Jul 30, 2012 6:25 pm


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 11 guests