Wednesday, March 04, 2015

wine: The 'but I have to run Windows' excuse killer for Linux

When I switched one of my work laptops to Linux, I assumed that I'd run into a handful of Windows-only apps that would make the switch untenable. This hasn't turned out to be the case. The majority of Windows requirements were addressed through web based apps and standard Linux based tools. For more obscure replacements (say, Picsa image management), I was able to find a Linux variant that worked as well (say, shotwell). More importantly, I'm finding the scriptable philosophy of Linux is making me even more productive than I was on Windows.

That's not to say that I haven't run into a couple of Windows specific challenges. To my delight, I've found wine is a lightweight, almost invisible solution, to this problem.

Two apps that I've run under wine include an ancient evoice audio player (needed to playback audio files from a free evoice account I use) and Anyplace Control's desktop viewing software.

The evoice player was my first foray into running a Windows app under Linux. It was more proof of concept than anything else, as the alternative was replacing the ancient evoice account with a more modern (though probably not free) solution. Using wine couldn't have been easier: I simply downloaded the .exe file and then ran: wine evoicesetup.exe. And to my amazement, the Windows installation popped up. Once the process was done evoice was installed, though it wasn't immediately obvious where.

Now, when I want to play back an evoice file I run this script:

#!/bin/bash

## A wrapper around the evoice windows app

if [ ! -f "$1" ] ; then
  echo "Usage: `basename $0` file.evc"
  exit
fi

wine 'c:\\Program Files (x86)\\eVoice Player 1.0\\eVoicePlayer.exe' $1

I derived that path by looking under ~/.wine/drive_c and converted it to the standard Windows format.

Admittedly, The above setup isn't perfect. When I run evoice under wine my xterm is filled with warning message like so:

But it plays back the audio just fine. And given how often I have to play these files, this solution is perfect.

Anyplace Control, a type of Remote Desktop software that one of my clients use, seemed like a taller order for wine. I ran wine AnyplaceControlInstall.exe and was greeted with this promising dialog:

I hit Next but nothing happened. After much experimentation I realized that the install was kicking off a bunch of windows and ratpoison was probably not displaying them properly. To address this I kicked off Xnest with the following script:

#!/bin/bash

##
## Kick off a full screen Xnest session
##
geom=`xwininfo -root | grep geometry`
target=:10

Xnest $target  $geom &
sleep 1

export DISPLAY=$target
twm &
xsetroot -solid SteelBlue
xterm &

This started up the Very Old School twm as its own little desktop universe. The install ran just fine from there.

To run Anyplace Control, I simply kick off an Xnest session like above and then run:

  wine 'c:\\Program Files (x86)\\Anyplace Control\\apc_Admin.exe'

Turns out, Anyplace Control runs even better than evoice, with far fewer warning messages. In fact it runs just as well on my Linux box, if not better, than it does on my Windows box.

I had no idea wine was such an unsung hero on Linux. It's a project that's been around forever (well, since 1993!) and effortelssly knocked down some of the trickiest hurdles to a Linux only lifestyle. Well done!

2 comments:

  1. Great to see you enjoying WINE. It is very sweet.

    Cool to learn about Xnest; never heard of it before!

    ReplyDelete
  2. Xnest is definitely handy, especially in the ratpoison world. That way, one very windowy app (which doesn't play nice in ratpoison) doesn't spoil your ability to use ratpoison.

    ReplyDelete