Saturday, March 26, 2016

Office 2010 in Wine + winetricks

It is possible to run Office 2010 (Professional Plus, x86) in Linux using Wine (1.8 Staging, 64 bits, -compat32). Its performance is good enough but it needs some tweaks. I followed the following procedure to install it and make it functional.

Installation
1. Create a new WINEPREFIX:
$ WINEARCH=win32 WINEPREFIX=~/.wine/Office2010_32  winecfg

2. Configure
a) Leave the Windows version as Windows XP.
b) Change the screen dpi in order to improve the fonts and GUI visualization. 
$ WINEPREFIX=~/.wine/Office2010_32 winecfg 
Graphics > Screen resolution: 160 dpi > OK
c) To allow Powerpoint to run properly, set 'riched20' to (native,builtin)

3. Mount the Office 2010 ISO file:
# mkdir -p /run/media/userx/dvd
# mount -t iso9660 -o loop ./officeproplus2010uk32.iso /run/media/userx/dvd

4. Run the installer:
I use to install only Word, Excel, Powerpoint, Publisher and its shared tools. Nothing about web sites, Access or SharePoint.
 $ WINEPREFIX=~/.wine/Office2010_32 wine /run/media/userx/dvd/setup.exe

5. Register and play.

6. To solve the window resizing problem:
I tried the solutions given in WineHQ, the first two worked but I didn't like the final behaviour. The third didn't work directly but I found the solution. This settings allows PowerPoint to show in full screen.
a) Go to System Settings > Window Management > Window Rules.
b) Create a new rule.
c) Give it a description such as MS Office.
d) Set Window class as Regular Expression.
e) As regex string use (without quotation marks): "\b(winword.exe|excel.exe|powerpnt.exe|mspub.exe)\b."
f) Check Match whole window class.
g) On tab Size & Position check Ignore requested geometry and set Force Yes.

7. Improve font rendering in Wine.
For more details check this, but I did not find a big difference in the visualisation.
a) Open regedit.
b) Go to [HKEY_CURRENT_USER\Control Panel\Desktop].
c) update the following entries:
    FontSmoothing=2
    FontSmoothingType=dword:00000002
    FontSmoothingGamma=dword:00000578
    FontSmoothingOrientation=dword:0000000

In case of problems or errors, try :
8. Configure the DLL:
$ WINEPREFIX=~/.wine/Office2010_32 winecfg
Libraries:
gdiplus (native)
msxml6 (native)
> OK

9. Install MS XML Core Service 6.0 sp1 (solves the problem of saving files):
$ WINEPREFIX=~/.wine/Office2010_32 winetricks 
Install and app > Cancel > Install a Windows DLL or Co/ mponent > OK > (check) msxml6 > OK
[I need to check the DLL configuration]

10. Create the folder ~/.wine/Office2010_32/drive_c/users/userx/Recent :
This avoids the creation of multiple .lnk files when you work in Office. The files will be created anyway, but inside the mentioned directory not in the office file's folder.
$ mkdir -/.wine/Office2010_32/drive_c/users/userx/Recent

Uninstalling
I couldn't make the uninstaller program work, first I tried with the wine uninstaller program, but I got an error after launching the Office uninstall application.
$ WINEPREFIX=~/.wine/Office2010_32 wine uninstaller

So, I uninstalled Office 2010 by brute force. 
1. Delete the wineprefix where it is installed:
$ rm -rf ~/.wine/Office2010_32

2. Remove the K menu and desktop entries:
$ rm -f ~/.config/menus/applications-merged/wine-Programs-Microsoft\ Office*
$ rm -rf ~/.local/share/applications/wine/Programs/Microsoft\ Office/
$ rm -f ~/.local/share/desktop-directories/wine-Programs-Microsoft\ Office*

3. Remove the Office applications icons:
Do it by hand looking in the folder: ~/.local/share/icons/

4. Remove the extensions .desktop definitions (remove from "Open With ..."):
Do it by hand looking in the folder: ~/.local/share/applications/



No comments: