How do I install MS Office 2016 on PlayOnLinux

How can I get playonlinux to install Microsoft Office 2016. The options from the install menu only go up to 2013.

Is there a more recent version of PlayOnLinux (or indeed Wine) I can download to enable installation of MS Office 2016?

The steps I take are:

  1. open PlayOnLinux
  2. click Install
  3. Click Office
    returns a list of several software packages including MS Office 2007, 2010 and 2013 (but alas not 2016)

I will provide directions that worked for me for a manual (non-script) installation of Microsoft Office 2016 Professional Plus on Ubuntu 18.04 using PlayOnLinux (POL) v4.3.4 and Wine x86 v3.4. All the apps except OneNote opens, though I have only really used Word and Excel so I can't speak for the functionality of the other apps.

PlayOnLinux with Office 2016 applications displayed

Firstly, try the default POL script and/or some of the other scripts here to check if they work because that would save you a lot of time and headache.

I tried the default script that comes with POL as well as some of the other scripts provided here but they became stuck (eg Office installation does not finish) or crashed at various points (eg "file not found" error). The below manual process essentially replicates those scripts and the advantage of this manual process is that you can see exactly where your specific setup might be encountering problems.

Parts of these instructions are based on GlasierXplor's POL forum post as well as other answers here.


Preparations

  1. Dependency installation: According to POL's website, wine:i386 needs to be installed. If you try to apt-get install wine:i386, it will fail because it is tied to 2 packages. On top of wine:i386, you will need smbclient and winbind for Office to start.

    • Note: DO NOT use --no-install-recommends to install wine-stable, as it will cause the Office installation to always crash due to some missing dependencies (didn't manage to pinpoint which packages).

    • sudo apt-get update

    • sudo apt-get install wine-stable:i386 smbclient winbind

    • smbclient -V #Confirms that smbclient is installed

    • winbindd -V #Confirms that winbind is installed

  2. Optional: Update POL to the latest version. This is because at one point POL gave an error indicating an update is needed and this error disappeared once I upgraded to POL v4.3.4. Here are the Ubuntu 18.04 (Bionic) instructions:

    • wget -q "http://deb.playonlinux.com/public.gpg" -O- | sudo apt-key add -
    • sudo wget http://deb.playonlinux.com/playonlinux_bionic.list -O /etc/apt/sources.list.d/playonlinux.list
    • sudo apt-get update
    • sudo apt-get install playonlinux
  3. Optional: download the Office 2016 installation file if you don't already have it or have a CD. You can download it from MS using one of the below options. I assume you have downloaded the Office 2016 Pro Plus version in the rest of this answer.

    • If the license is tied to your MS account, then use your account dashboard.
    • If you have the product key, use the Download Earlier Versions of Office page.
    • If you just want to test installation, try downloading using one of these direct links. Office 2016 Pro Plus link is the first one on that page.
  4. Optional: Install winetricks and mono. I received various errors relating to winetricks and mono from the scripts I tried previously so I had already installed these by the time I tried the manual installation. It is uncertain whether installing these made any difference so you could try the manual installation steps below first and then come back to this step if you encounter errors.

    • sudo apt-get install winetricks
    • winetricks dotnet45
  5. Optional: Remove previous unsuccessful installation of Office 2016 on POL. If your tried installing using the scripts, there may be POL Virtual Drives with empty or partial installations. You may want to remove these drives before trying the below installation process.

  6. Optional: Restart the computer just to be extra careful.

  7. Note In any situation where you use a multiple displays with your computer, Office will not display correctly if:-

    • Start Office with an additional display
    • Close Office
    • Disconnect any additional displays
    • Start Office

    Office will start with a maximum size restricted to the top left of your primary display, and will refuse to respect the size of your desktop, until you connect the "correct" number of displays again. In which case Office will act normally (subjective) again.

    E.g.

    • Install office with 2 displays
    • Start office with 3 displays
    • Close office and disconnect any number of displays (e.g. leave 1 display)
    • Start office again. Office will start in the top left of your primary display.
    • Connect 1 display to your computer (so now we have 2 displays).
    • Start office again. Office will still start in the top left of your primary display.
    • Office will only act properly if you connect the max number of displays you started Office in at any point of time (in this case 3 displays)

Setup POL

To consider: Wine x86 version 4.15 is more stable than 3.4 (below), or 3.14 (GlasierXplor's post on POL Forum). I.e. it does not crash randomly. The caveat is that there will be some issues with images, but should work fine 97~% of the time. Wine 4.15 requires the POL 4.3.4 update from the official POL repositories to be installed.

  1. Wine x86 version 3.4 was used for this installation so check if it is installed by starting POL and then selecting Tools -> Manage Wine Versions. Manage Wine Versions window with x86 version 3.4 installed

  2. If Wine x86 version 3.4 does not appear under "Installed Wine versions", then select it from the "Available Wine versions" window and click on the > in the middle to install it. Once installed, close and exit to the main POL menu.

  3. In POL, select Configure to enter the configuration screen and then click New in the bottom left to start the Virtual drive creator.

  4. Select 32 bits windows installation and press Next. Play On Linux 32 32 bits windows installation

  5. Select Wine version 3.4 and press Next.

  6. Give the virtual drive a name (eg Office2016pp) and press Next to start the creation. Select to install Mono if POL asks.

  7. Once the virtual drive creation is complete, you should be back in the main POL configuration screen. Ensure the newly created drive (eg Office2016pp) is selected on the left window.

  8. Click on the Install components tab at the top. Then scroll down to select msxml6 and click Install.

POL install component msxml6

  1. Repeat above step to install component riched20.

  2. Select the Wine tab in the POL Configuration screen and then click on Configure Wine.

  3. Once the Wine Configuration screen appears, click on the Libraries tab. Click Edit to change both msxml6 and riched20 to (native, builtin). Wine Configuration edit libraries

  4. In the Wine Configuration screen, click on the Applications tab and ensure that Windows 7 is selected as the Windows version. Exit to the POL configuration screen.

  5. Select the Wine tab in the POL Configuration screen and then click on Registry Editor to open the Registry Editor.

  6. Select to HKEY_CURRENT_USER->Software->Wine and

  7. Click Edit->New->Key and name this key Direct2D.

  8. Select Direct2D and then Edit->New->DWORD Value named max_version_factory with a value of 0.

enter image description here

  1. Close the Registry Editor and return to the POL Configuration screen.

Install Office

  1. Insert installation disk or mount the Office 2016 installation image file (eg ProPlusRetail.img). Double-clicking the image file on Nautilus should automatically mount it.

  2. In the Pol configuration screen, click on the Miscellaneous tab and click on Run a .exe file in this virtual drive to open the Select a file menu.

  3. In the Select a file menu, select Setup32.exe in the Office 2016 drive (eg in the Office folder) to start the Office 2016 installation process. Hopefully it will install properly and exit without any errors.

  4. Once the installation is complete, close the POL configuration screen to exit to the main POL screen.

  5. In the main POL screen, click Tools->Close all PlayOnLinux software.

  6. In the main POL screen, click Configure to go to the POL configuration menu and select Office2016pp (or whatever name you used) drive in the left hand.

  7. In the Pol configuration screen, click on the Miscellaneous tab and click on Open virtual drive's directory to open a new Nautilus ("Files") window.

  8. Using Nautilus go to folder drive_c/Program Files/Common Files/Microsoft Shared/ClickToRun/ and copy AppvIsvSubsystems32.dll and C2R32.dll to drive_c/Program Files/Microsoft Office/root/Office16/.

Nautilus ClickToRun folder view

  1. Close Nautilus and go back to the POL configuration screen.

  2. In the Pol configuration screen, click on the General tab and click on Make a new shortcut from this virtual drive to start the POL Wizard in order to create links to the Office apps.

POL create links to apps

  1. You will need to select the executable for each office app and name the link. Note that some of these apps (eg OneNote) may not work at all.

    • Select file WINWORD.EXE and name the link Microsoft Word 2016
    • Select file EXCEL.EXE and name the link Microsoft Excel 2016
    • Select file POWERPNT.EXE and name the link Microsoft Powerpoint 2016
    • Select file MSACCESS.EXE and name the link Microsoft Access 2016
    • Select file OUTLOOK.EXE and name the link Microsoft Outlook 2016
    • Select file ONENOTE.EXE and name the link Microsoft OneNote 2016
    • Select I don't want to make another shortcut to exit the wizard.
  2. Close the POL configuration screen to exit to the main POL screen. You should now see the apps you now linked to in the main POL screen.

PlayOnLinux with Office 2016 applications displayed

  1. Double click on MS Word inside POL to run it and you will be asked to activate Office. When complete, close Word and close POL.

  2. You should also find new .desktop files for each off the office apps on your desktop. You can copy or move these files using Nautilus into ~/.local/share/applications if you want them to appear in the Ubuntu dash and 'select application' menus.


Post-Instalation

  1. Optional: Insert categories into .desktop files. Edit each .desktop file and enter the Categories information to assist with searching. You can edit each file by right-clicking it -> Open with other Application -> Text Editor.

    • Microsoft Word 2016.desktop update Categories=Office;WordProcessor;
    • Microsoft Excel 2016.desktop update Categories=Office;Spreadsheet;
    • Microsoft Powerpoint 2016.desktop update Categories=Office;Presentation;
    • Microsoft Access 2016 update Categories=Office;Database;
    • Microsoft Outlook 2016 update Categories=Network;Email;
    • Microsoft OneNote 2016 update Categories=Office;WordProcessor;
  2. Optional: Update POL's extension file. Start POL and click Setting under Actions on the left side of the screen. Then associate the extensions and programs as shown below.

POL Extensions

  1. Optional: Set Office .desktop files as trusted to avoid the "Untrusted application launcher" warning. You only need to do this if it's causing problems.

    • Open a shell in ~/.local/share/applications and type:
    • gio set "Microsoft Word 2016.desktop" "metadata::trusted" yes
    • gio set "Microsoft Excel 2016.desktop" "metadata::trusted" yes
    • gio set "Microsoft Powerpoint 2016.desktop" "metadata::trusted" yes
    • gio set "Microsoft Access 2016.desktop" "metadata::trusted" yes
    • gio set "Microsoft Outlook 2016.desktop" "metadata::trusted" yes
    • gio set "Microsoft OneNote 2016.desktop" "metadata::trusted" yes
  2. Optional: Install Office 2016 updates. This is still a work in progress. Watch this post for updates.


Below is the first version of Office 2016 script for PlayOnLinux (based on Office 2013 one).

It uses Wine 3.0, but sometimes it crashes on Office Welcome screen when trying to call unimplemented function KERNEL32.dll.FindNLSStringEx called in 32-bit code.
So we need Wine 3.4+ here, but I can't run this script with it on my Ubuntu 16.04 LTS.

Testing and help from more experienced users are really needed.

The script:

#!/bin/bash

# CHANGELOG
# Version 0.0.1 by N0rbert - with Wine 3.0 it crashes on Welcome screen when trying
# to call "unimplemented function KERNEL32.dll.FindNLSStringEx called in 32-bit code"
# So we need Wine 3.4+ here, but I can't run this script with it on my Ubuntu 16.04 LTS.
#
# based on Version 1.1.0.0 [Quentin Pâris and Eduardo Lucio (Questor)] (2018-02-17 15-24) - Paris/Brazil
# for office2007pro (playonlinux://www.playonlinux.com/repository/download.php?id=2665)

# >>>>>>>>>>
# Under BSD License!

# Copyright (c) 2018, Quentin Pâris, Eduardo Lucio and N0rbert
# All rights reserved.

# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the name of the free software community nor the
#       names of its contributors may be used to endorse or promote products
#       derived from this software without specific prior written permission.

# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Quentin Pâris and Eduardo Lucio BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# <<<<<<<<<<

# NOTE: Complete liste of references! By Questor
# https://github.com/PlayOnLinux/POL-POM-4/blob/master/lib/wine.lib
# https://www.playonlinux.com/en/app-2665-Microsoft_Office_2016.html
# http://wiki.playonlinux.com/index.php/Scripting_-_Chapter_11:_List_of_Functions
# http://wiki.playonlinux.com/index.php/Components_and_Functions
# https://www.playonlinux.com/repository/source.php?script=822
# https://github.com/PlayOnLinux/POL-POM-4/blob/367e50865168b5b931611fa33b0c1d8426143a90/lib/scripts.lib
# https://github.com/PlayOnLinux/POL-POM-4/blob/367e50865168b5b931611fa33b0c1d8426143a90/lib/wine.lib
# https://askubuntu.com/questions/879304/wine-2-0-says-it-supports-office-2016-how-do-i-actually-install-it
# https://github.com/RobertJames/playonlinux/blob/75ef37523f299255a539a89b63dc87d7afc096d4/template.POL

# N0rbert's links:
# https://bugs.winehq.org/show_bug.cgi?id=41911 (really we need Wine 3.4+ to fix FindNLSStringEx errors)

# >>>>>>>>>>
# Initialization!

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

PREFIX="office2016"

WINEVERSION="3.4"

TITLE="Microsoft Office 2016"

# NOTE: Images to use! By Questor
POL_GetSetupImages "https://i.imgur.com/licFVuF.png" "https://i.imgur.com/ff6PkEZ.png" "$TITLE"

POL_SetupWindow_Init
POL_SetupWindow_SetID 3064

POL_SetupWindow_presentation "$TITLE" "Microsoft" "http://www.microsoft.com" "Quentin Pâris, Eduardo Lucio and N0rbert" "$PREFIX"

POL_Debug_Init

# <<<<<<<<<<

# >>>>>>>>>>
# Perform some validations!

POL_RequiredVersion 4.2.10 || POL_Debug_Fatal "$TITLE won't work with $APPLICATION_TITLE $VERSION!\nPlease update!"

if [ "$POL_OS" = "Linux" ]; then
    wbinfo -V || POL_Debug_Fatal "Please install winbind before installing $TITLE!"
fi

if [ "$POL_OS" = "Mac" ]; then

    # NOTE: Samba support! By Quentin Pâris
    POL_Call POL_GetTool_samba3
    source "$POL_USER_ROOT/tools/samba3/init"

fi

POL_Wine_WaitBefore "$TITLE"
[ "$CDROM" ] && cd "$CDROM"

if [ ! "$(file $SetupIs | grep 'x86-64')" = "" ]; then
    POL_Debug_Fatal "$(eval_gettext "The 64bits version is not compatible! Sorry!")";
fi

# NOTE: Check if "winetricks" is present! By Questor
winetricks -V || POL_Debug_Fatal "Please install winetricks before installing $TITLE!"

POL_System_SetArch "x86"
POL_SetupWindow_InstallMethod "LOCAL,DVD"

if [ "$INSTALL_METHOD" = "DVD" ]; then
    POL_SetupWindow_cdrom
    POL_SetupWindow_check_cdrom "x86/setup.exe" "setup.exe"
    SetupIs="$CDROM_SETUP"
    cd "$CDROM"
else
    POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run!')" "$TITLE"
    SetupIs="$APP_ANSWER"
fi

# <<<<<<<<<<

# >>>>>>>>>>
# Prepare resources for installation!

# NOTE: Install wine version if isn't available. This is necessary because
# even though "POL_Wine_PrefixCreate" solves this, we end up having
# problems when the required version is not available and it tries to
# install it! Questor
# [Ref.: https://github.com/PlayOnLinux/POL-POM-4/blob/master/lib/wine.lib]
POL_Wine_InstallVersion "$WINEVERSION"

POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WINEVERSION"

Set_OS "win7"

# Fix black windows (added by N0rbert)
POL_Wine_Direct3D "MaxVersionGL" "30002"

# <<<<<<<<<<

# >>>>>>>>>>
# Install!

# NOTE: Installs office! By Questor
POL_Wine "$SetupIs"
POL_Wine_WaitExit "$TITLE"

# <<<<<<<<<<

# >>>>>>>>>>
# Prepare resources for applications!

# NOTE: Uses native special version of "riched20" installed by Office 2016!
# Fix the "black fields" issue! By Questor
# [Ref.: http://forum.winehq.org/viewtopic.php?f=8&t=23126&p=95555#p95555]
POL_Wine_OverrideDLL "native,builtin" "riched20"

# NOTE: Fix "move and change the window size (maximize/minimize/restore/resize
# etc...) bugs"! By Questor
# [Ref.: https://bugs.winehq.org/show_bug.cgi?id=44552]
Set_Managed "Off"

# <<<<<<<<<<

# >>>>>>>>>>
# Create shortcuts, entries to extensions and finalize!

# NOTE: Create shortcuts! By Questor
POL_Shortcut "WINWORD.EXE" "Microsoft Word 2016" "" "" "Office;WordProcessor;"
POL_Shortcut "EXCEL.EXE" "Microsoft Excel 2016" "" "" "Office;Spreadsheet;"
POL_Shortcut "POWERPNT.EXE" "Microsoft Powerpoint 2016" "" "" "Office;Presentation;"

# NOTE: No category for collaborative work? By Quentin Pâris
POL_Shortcut "ONENOTE.EXE" "Microsoft OneNote 2016" "" "" "Network;InstantMessaging;"

# NOTE: "Calendar;ContactManagement;"? By Quentin Pâris
POL_Shortcut "OUTLOOK.EXE" "Microsoft Outlook 2016" "" "" "Network;Email;"

# NOTE: Add an entry to PlayOnLinux's extension file. If the entry already
# exists, it will replace it! By Questor
# [Ref.: https://github.com/PlayOnLinux/POL-POM-4/blob/master/lib/playonlinux.lib]
POL_Extension_Write doc "Microsoft Word 2016"
POL_Extension_Write docx "Microsoft Word 2016"
POL_Extension_Write xls "Microsoft Excel 2016"
POL_Extension_Write xlsx "Microsoft Excel 2016"
POL_Extension_Write ppt "Microsoft Powerpoint 2016"
POL_Extension_Write pptx "Microsoft Powerpoint 2016"

if [ "$POL_OS" = "Mac" ]; then
    POL_Shortcut_InsertBeforeWine "Microsoft Word 2016" "source \"$POL_USER_ROOT/tools/samba3/init\""
    POL_Shortcut_InsertBeforeWine "Microsoft Excel 2016" "source \"$POL_USER_ROOT/tools/samba3/init\""
    POL_Shortcut_InsertBeforeWine "Microsoft Powerpoint 2016" "source \"$POL_USER_ROOT/tools/samba3/init\""
    POL_Shortcut_InsertBeforeWine "Microsoft OneNote 2016" "source \"$POL_USER_ROOT/tools/samba3/init\""
    POL_Shortcut_InsertBeforeWine "Microsoft Outlook 2016" "source \"$POL_USER_ROOT/tools/samba3/init\""
fi

POL_SetupWindow_message "$(eval_gettext '$TITLE has been installed successfully!\n\nThanks!\nBy Quentin Pâris, Eduardo Lucio and N0rbert')" "$TITLE"
POL_SetupWindow_Close

# <<<<<<<<<<

exit 0

One should save it as pol-mso2016.sh and then load it into PlayOnLinux by selecting Tools -> Run a local script and then follow instructions on the screen.