Category: Wine

Wine, MS Office, and Gvfs

They are three different pieces of software, but they can work together:

  • Wine: a tool to run Windows-based software on Linux/Unix operating systems
  • MS Office: the most popular office suites, a tool that needs Wine to run on Linux
  • GVFS: the file system built into Gnome that allows network access

Here is the scenario — you go into the office with your Ubuntu laptop, and your project has an Excel Spreadsheet that you have to use to collaborate on.  Sure, Google Docs would be better for collaborating, but you don’t have a say in the matter.  So, you can either dust off the installation of Windows on the other partition (and install the 500 updates pending), or you can install Office on top of Linux with Wine.

Now, you can get to the spreadsheet in the Gnome File Manager (nautilus) using the network features.  I usually press Ctrl+L to open up the box where you can type in a URL.  Then, I type something like — smb://<server name>/<share>/.  It will probably ask you for your credentials to login to the share, but you should be able to see the xls file.

The next challenge is how do you open it in Office.  Office doesn’t understand the network locations that Gnome knows about.  Really, Wine is what doesn’t know about the network.  Gnome mounts the network share under the .gvfs directory.  Wine doesn’t show the hidden directories, so you can’t get to it.

To solve that problem, I created a network folder that is not hidden, and I linked the .gfvs directory to it:

ln -s ~/.gvfs ~/network

Now, I can see the samba shares in the Office open dialog.  I do still have to go to the File Manager and browse to the share first — that is what mounts it.  Then, I can open it in Office.

I also had an issue with multiple people having the same spreadsheet open.  I opened the spreadsheet, so I should have had the exclusive rights to update it.  Then, my coworker opened the same spreadsheet, and it should have made her’s read only.  Mine was editable like it should have been but so was hers.  Then, when I tried to save it, I gave me an error.  I haven’t experimented with it enough to know if that was a one-time glitch in the network, or if that is something I have to worry about.

I found this bug listing, but my problem was different.  I have written to the share in the past, so I don’t think it is report 0 bytes free.  I found this article that describes what I am doing much better.

The other feature I wish I could have is the ability to drag the files from the file manager to Word or Excel.  It works if the file is on my own computer, but it doesn’t when I am on the network.  Maybe one day…

IE Tester

I saw this link on a new IE Tester.  It looks like a really great idea.  I only looked at it quickly, but I think it only runs on Windows.  My big problem is that I don’t normally use Windows period and don’t have access to any version of IE.

Here are the links for the IE Tester:

Another option: run IE in Wine.  You can have multiple Wine homes in which you could load multiple versions of IE.  I know I have seen tutorials for loading IE6 in Wine, and I think just recently some tutorials for IE7 popped up.

Installing Office 2007 on Ubuntu

Here is a little script that I put together that installs Office 2007 for me.

Now, this script makes the following assumptions:

  • I already have a directory created called wine in my home directory.
  • I want Office installed in a separate directory/wineprefix
  • I have the Office CD mounted already at /media/cdrom0
  • I have winetricks in my path (which winetricks = /usr/local/bin/winetricks)

Also, just for information, here is my setup

  • Ubuntu 8.10
  • Wine version 1.1.16
  • I believe I installed Wine with apt-get using the repository at http://wine.budgetdedicated.com/apt
export WINEPREFIX=$HOME/wine/office2007

mkdir $WINEPREFIX
winetricks msxml3 dotnet20 gdiplus riched20 riched30 vcrun2005sp1 allfonts ie6
winetricks vista
wine /media/cdrom0/setup.exe
winetricks winxp

I hope it helps.

Office 2007 on Wine

I just had a situation at work where I am forced to use Microsoft Office.  Normally, Open Office does everything that I need it to do, but this was different.  First, the documents were large and had many graphics (textbooks).  Open Office seemed to hang just scrolling through them.  Second, others in the office would be using Microsoft Word to edit the documents, and if I used Open Office, the document would have to go back and forth between the two.

In order to stay on Linux, I used a tool called Play On Linux to get Word to run inside Wine.  Wine is a Windows Emulator that allows Windows programs to run on top of Linux.  Play On Linux is a tool to make installation and configuration of Wine much easier.

A script did not exist for Office 2007, but one did for Office 2003.  So, I took that script and modified it to work.  I did submit it to the Play On Linux website so that others could use it, but it is in the process of being validated.  Watch for it here.  This is my first script, and so don’t expect too much!  Here it is while they validate it:

#!/bin/bash

if [ "$PLAYONLINUX" = "" ]
then
echo "Ce script doit être executé dans PlayOnLinux."
exit 0
fi
source "$PLAYONLINUX/lib/sources"

#Verifier les dépendences
cfg_check

#Presentation
POL_SetupWindow_Init
POL_SetupWindow_presentation "Office 2007" "Microsoft" "http://www.microsoft.com" "Tinou modified by Stephen Phillips" "Office2007" 1 5
POL_SetupWindow_cdrom
if [ "$POL_LANG" == "en" ];  then
POL_SetupWindow_textbox "What is the name of the setup program?" "Office 2007" "setup.exe"
else
POL_SetupWindow_textbox "Quel est le nom du fichier d'installation ?" "Office 2007" "setup.exe"
fi
SETUP="$APP_ANSWER"
POL_SetupWindow_check_cdrom $SETUP

mkdir -p $REPERTOIRE/wineprefix/Office2007
select_prefixe "$REPERTOIRE/wineprefix/Office2007"
POL_SetupWindow_prefixcreate

cd $WINEPREFIX/dosdevices
rm ./*
ln -s ../drive_c c:
ln -s / z:
ln -s $CDROM ./d:

#Set_WinVersion_Session 0.9.46

cd $CDROM
if [ "$POL_LANG" == "en" ];  then
POL_SetupWindow_wait_next_signal "Installation of Office 2007 in progess..." "Office 2007"
else
POL_SetupWindow_wait_next_signal "Installation de Office 2007 en cours..." "Office 2007"
fi
wine $SETUP
POL_SetupWindow_detect_exit
POL_SetupWindow_reboot

#Fin du code du jeu
#Création du lanceur

POL_SetupWindow_make_shortcut "Office2007" "Program Files/Microsoft Office/Office12" "EXCEL.EXE" "excel.xpm" "Excel 2007"
POL_SetupWindow_make_shortcut "Office2007" "Program Files/Microsoft Office/Office12" "WINWORD.EXE" "word.xpm" "Word 2007"
POL_SetupWindow_make_shortcut "Office2007" "Program Files/Microsoft Office/Office12" "POWERPNT.EXE" "powerpoint.xpm" "Powerpoint 2007"
POL_SetupWindow_make_shortcut "Office2007" "Program Files/Microsoft Office/Office12" "MSPUB.EXE" "publisher.xpm" "Publisher 2007"
POL_SetupWindow_make_shortcut "Office2007" "Program Files/Microsoft Office/Office12" "ONENOTE.EXE" "onenote.xpm" "OneNote 2007"

if [ "$POL_LANG" == "en" ];  then
POL_SetupWindow_message "Installation finished" "Office 2007"
else
POL_SetupWindow_message "Installation terminée" "Office 2007"
fi
POL_SetupWindow_Close
exit

Resources