Thursday 23 April 2015

Elementary OS Freya - Part 3 Viber running on 32 bit Linux

Viber for Windows running in ElementaryOS Freya on my Dual Monitor system with ViberStart and ViberKill added to Docky **  Wallpaper - Henning Island Whitsundays QLD
 
It had to happen!  I use Viber a hell of a lot and while the Viber people have released the 64 bit packages for Linux, it is a pain to get it working on 32 bit Linux.  Since I had already made Viber for Windows run on Mint, I decided to see if it would run in Elementary.  The good news was, it did.  The bad news I suppose is that I need to post the method here and bore people with details.

In the past I had used WINE to install Viber and it used to run, but somewhere in a recent release of either Linux or Viber for Window, the excutable would install, the come up with errors every time it ran.

A couple of weeks ago however I remembered PlayOnLinux and decided to see if it was good for more than games.  It is in pretty well all repositories, so I just installed it and opened it.

So here is a rather lengthy diatribe on getting it set up.  There are no messy configurations to do and no extra dll files and stuff to find as I had to in Wine.  You simply follow what is written here and it should all work.

Where you see the path /home/YOUR-USER-NAME/.PlayOnLinux/  Simply change 'YOUR-USER-NAME' to whatever is the username for that home folder. 

So an example if your logged in user is robert would be to change:

/home/YOUR-USER-NAME/.PlayOnLinux/wineprefix/_/drive_c/users/YOUR-USER-NAME/Local Settings/Application Data/Viber/Viber.exe

to :
/home/robert/.PlayOnLinux/wineprefix/_/drive_c/users/robert/Local Settings/Application Data/Viber/Viber.exe

ANOTHER WARNING that will be mentioned again below. 

When you get to either entering a command in a Terminal to start Viber, watch out for spaces and backslashes in the path.  If they are not in the right place - it won't work!

OK  HERE GOES:

Install PlayOnLinux

Download Viber for Windows.
Install the ViberSetup.exe or Viber.exe (whatever whatever it was called) using PlayOnLinux.


Open PlayOnLinux.  It was in the Applications Menu, Games, PlayOnLinux.

On the right, choose Install a Program.
When the Install Menu opens, look at the bottom and click on Install a non-listed program.  (If you don't see an option to Install a non-listed program, open and close a few of the Install options.  It will turn up at the bottom of one of them eventually as a line of text link)

The Manual Installation dialog will open, click Next
If you have NOT used PlayOnLinux before, click on install a program in a new virtual drive
Type in a name for your new virtual drive WITH NO SPACES

Now, Mr Intelligence here forgot to type in a name, so I ended up with a virtual drive called "_" 

NOTE !!!  Don't skip typing in a NAME for the virtual drive.    

Click Next and Follow the rest of the prompts


Yep, so my drive is in a folder called 'underscore'.
In the examples below I used 'NAME-OF-VIRTUAL-DRIVE'  to represent whatever you call your PlayOnLinux virtual drive when asked.

You should be asked if you want to Use another version of Wine. Configure Wine or Install some libraries.  You can skip this and click Next.

Once you get through this stuff you should be asked to Please select the install file to run.
Click Browse and find the installation file wherever you downloaded it. 
In my case, in a folder called Software Downloaded/Viber
Click the Viber.exe file and wait.

It 'SHOULD" install to the following directory - but it could take some finding. 
Do a search for Viber.exe in your file manager and you should find it in something like this below  NOTE the dot before PlayOnLinux - it is a Hidden Folder so if you go looking for it, select Show Hidden Files in your File Manager:  

/home/YOUR-USER-NAME/.PlayOnLinux/wineprefix/NAME-OF-VIRTUAL-DRIVE/drive_c/users/YOUR-USER-NAME/Local\ Settings/Application\ Data/Viber/Viber.exe

Find executable and open with PlayOnLinux and SAVE the association Always Open This Type etc..
Once it has opened, you will be asked to provide your phone number.  A pin code will be sent to your mobile.
Enter the pn and Viber should open.  If you already have Viber on a device, you shoudl see your contacts.
Once you verify it is working, close Viber and close PlayOnLinux.

NOTE playonlinux Terminal command is in LOWER case, even though the folder name is mixed upper and lower case.



Then use this command in a terminal to start Viber. 

playonlinux /home/YOUR-USER-NAME/.PlayOnLinux/wineprefix/NAME-OF-VIRTUAL-DRIVE/drive_c/users/ross/Local\ Settings/Application\ Data/Viber/Viber.exe

Viber for Windows does not like to shut down in Linux so I Kill Viber with this (I made an executable script).
In my Mint 17 if I don;t kill Viber Process after I close the actual Viber Program, my monitors shut down and they don't want to start again.
---------------
!#/bin/bash
   # a simple script to kill the processes in memory at the same time as killing Viber for Windows
   # By Ross Devitt
   # Kills Wine version of Viber.
   # I found I need it because Viber causes monitor power save mode to cut in and shuts doem my screens.
pkill Viber.exe     # Kills Viber
pkill playonlinux   # Kills PlayOnLinux
pkill python        # Kills Python to stop PlayOnLinux restarting itself over and over
pkill explorer.exe  # Kills the Windows bits
 
---------------

Once that is done you should be able to use the command in a script, a link or a launcher.
I opened my /home/me/Desktop folder and Right Clicked in the folder and created a 'Link ro Application'
then I just pasted this into the Command box on the Application tab:

playonlinux /home/YOUR-USER-NAME/.PlayOnLinux/wineprefix/NAME-OF-VIRTUAL-DRIVE/drive_c/users/YOUR-USER-NAME/Local\ Settings/Application\ Data/Viber/Viber.exe

Next I changed the icon for the Viber icon and put VIBER in the Name field.  I left the Work path empty.

I hope this helps a few people who want to use Viber in 32 bit Elementary OS Freya or otehr 32 bit Linux Distros.



Remember - there IS a working 64 bit Viber for Linux, but it is a pig to set up in 32 bit distros.

This post might seem to have too much detail, but it is easy to miss things so there are lots of reminders in there.

Have fun with ElementaryOS and Viber.


RossD.





No comments:

Post a Comment