17

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)
  • 1
    Possible duplicate of Office 2016 Installation Using PlayOnLinux askubuntu.com/questions/777142/… – lapisdecor Nov 10 '17 at 16:22
  • Unfortunately MS Office 2016 is currently not working on Wine or PlayOnLinux. The best option you have if you absolutely need this version is to just create a Windows VirtualBox instance and install it on there. – Gladen Nov 14 '17 at 12:26
5

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.

| improve this answer | |
  • Doesn't the official Wine PPA support Wine 3.4 on Ubuntu 16.04? If so, you could use that Wine version, and set the script to use the 'System' Wine Version instead of defining a certain version number. Also you might want to make sure PlayOnLinux is the latest version via the PPA, in case it's the version of POL preventing the usage of Wine 3.4 in Ubuntu 16.04. – Dominic Hayes Sep 8 '18 at 10:17
  • Could you host it in a gist or somesuch? It's a little hard to copy from the webpage here. – retorquere Sep 10 '18 at 19:31
  • 1
    Testing in 18.10 with POL 4.3.2 and wine 3.4, the setup.exe installation failed – user47206 Nov 20 '18 at 11:41
4

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 "fine 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.

    • 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.

  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 Installing with multiple displays connected may cause configuration problems, so consider disconnecting any additional 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.

  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.

| |
  • Hi, GlasierXplor here. Just a few notes: after trying to install Office2016 multiple times: winbind needs to be installed in my tests, or else the installer will crash before it starts. I have also tried on wine 4.15 (x86) and it is waaaaaay more stable than in my original answer (3.19). E.g. no more random crashes. – Timothy Wong Jun 7 at 16:35
  • @TimothyWong firstly, thanks for your original instructions. Re:winbind - I already had it installed, so I can't test it. Before which above step does it need to be installed? I will update my answer with a note. – JayDin Jun 9 at 0:16
  • @TimothyWong Re wine 4.15 - I do get random office crashes with Wine x86 v3.4 - especially from excel. Powerpoint also does not function well. Do you know if it's ok for me to just change the wine version for the office installation from v3.4 to v4.15? Or do I need to reinstall office? – JayDin Jun 9 at 0:19
  • Re: winbind, as long as it is installed before you start the Setup32.exe. It will crash if not installed, but if you install it after it will still work. Re: wine 4.15, if i recall correctly, I tried that once, but it ended up crashing all applications (it won't even start). A clean install is definitely the way to do this. – Timothy Wong Jun 9 at 6:07
  • Not all hero's wear capes – Jesse de gans Jun 29 at 17:31
3

What worked for me was translating intructions from WineHQ (here) and here to use with PlayonLinux, with Wine 3.4.

  1. Create a new virtual drive
  2. Install msxml6 and riched20 from tab "Install Components"
  3. Configure wine to use msxml6 and riched20 (native, builtin)
  4. Copy the AppvIsvSubsystems32.dll and the C2R32.dll from: /Program Files/Common Files/Microsoft Shared/ClickToRun/ to: /Program Files/Microsoft Office/root/Office16/
  5. Edit registry by adding a DWORD named HKCU/Software/Wine/Direct2D/max_version_factory, set to zero.
| improve this answer | |
  • 1
    It didn't work for me in 18.10. Step 4 is to be done after the installation of msoffice I imagine, otherwise that file to be moved is absent. But executing msoffice setup.exe fails. – user47206 Nov 20 '18 at 11:37
  • I had to copy the file "AppvIsvStream32.dll" as well in step 4. Also, as pointed out by user47206, running the installer has to be done before step 4. – Mohamed Y. Mar 16 at 10:48
2

For me the script from above (originally by Quentin Pâris, Eduardo Lucio and N0rbert) worked to install Office 2016 Pro Plus under Ubuntu 18.04, with the only changes:

  • wine version 3.0
  • msxml6 in addition to riched20 as overrideDLL

So far Word, Excel, and Powerpoint work, while OneNote and Outlook crashed (don't use them so I didn't even try to fix). Activation worked also, for this open Word -> File -> Account and enter the license key. Here the script, proceed as described above (save as .sh and run under PlayOnLinux -> Tools -> Run local 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.0"

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"
POL_Wine_OverrideDLL "native,builtin" "msxml6"

# 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
| improve this answer | |
  • 1. I have run the script - msoffice installer error "something went wrong"; closing; 2. install msxml6 and riched20 libraries in the newly created office2016 wine3.0 drive (Configure); 3.Configure office2016 drive - configure wine - Libraries - to use the two; 4. re-start the script in POL, selecting overwrite contents; 5.selecting setup.exe (32x), the installer works (clicking the tray icon to see the progress), press Enter at the end; 6. Create shortcut from the drive. -- But none works - "Error in main" – user47206 Nov 20 '18 at 13:29
0

Had to use POL wine 3.14 (latest 3.19 or 3.0 /3.4 did not work for me) on Ubuntu 18.04 and steps 1-5 post Kevin to get MS Office 2016 (Word/Excel/Powerpoint) started. If you download the complete office 2016 IMG file, the installation includes your personal license and is already activated on start.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.