Month: October 2008

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