Friday 1 May 2015

Install Office2010 in Wine1.7 on Ubuntu 14.04

At May 2015, since newer versions of Ubuntu and Wine does not install winbind and samba by default, using the old method for installing Office2010 will cause an error:
err:msi:ITERATE_Actions Execution halted, action L"CAInstallSppPlugin.x86" returned 1603

and fail halfway with "Microsoft Office has encountered an error during setup" and the installation will abort.

Here are the steps:
1. install wine1.7 via ppa (root)
add-apt-repository ppa:ubuntu-wine/ppa
apt-get update
apt-get install wine1.7

2. install OpenGL packages
apt-get install mesa-utils mesa-utils-extra libgl1-mesa-glx:i386 libgl1-mesa-dev lib32z1

3. link OpenGL packages
ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/mesa/libGL.so
ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so /usr/lib/i386-linux-gnu/libGL.so

4. install samba and winbind
apt-get install samba winbind

5. create 32-bit wine prefix
export WINEARCH=win32
export WINEPREFIX=$HOME/.wine32
(you can name .wine32 to anything you like, but subsequent things you do will only apply to that prefix folder)


6. (Optional) install winetrick dll components
winetricks vcrun2008 dotnet20 dotnet40 msxml6
winetricks riched20 riched30 gdiplus vb6run ie8 corefonts

7. run winecfg
make sure it is Windows XP, with riched20 and gdiplus set to native(windows)

8. Run office2010 setup
wine office2010-setup/setup.exe

9. Edit registry
If you encounter a window pop out saying "Please wait while windows configures Microsoft Office Professional Plus 2010" everytime you open Word2010, run registry editor to add the following variable:
reg add HKCU\Software\Microsoft\Office\14.0\Word\Options /v NoReReg /t REG_DWORD /d 1

10. Set environment to type Chinese in Office,
LC_ALL=zh_CN.UTF-8 wine .wine32/drive_c/Program\ Files/Microsoft\ Office/Office14/WINWORD.EXE