Update: PlayOnLinux have finally added this feature so you do not need to do this manually any more! But you still have to add "$(echo "$@" | sed -e 's:/*/:\\:g')"
in the end.
First make sure you are showing hidden files by open homefolder. Click on edit then preferences and tick the bar. Close the window.
Then you type the command
sudo nautilus
Type in your password. Then you will need click yourself to top of disk. Then go to usr/share/applications. There try to find the word icon. If you dont finde it then copy the icon from the desktop and paste it in the folder. Right click on the icon you just pasted and click on properties. Change the "command" to
playonlinux --run "Microsoft Word 2010" z:%f
(Make sure to teave the " in) For Powerpoint you just change "Word
" to "Powerpoint
" And if you are running office 2007 you just change "2011
" to "2007
"
Do this with all the icons you want to set file associations for. Then close the Window.
If you have the updated program start from here:
Then open home folder. Click on .playonlinux/shortcuts
There you will find different files named exel powerpoint and word. Open one with notepad.
The file should look something like this:
#!/bin/bash
[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"
export WINEPREFIX="/home/leo/.PlayOnLinux//wineprefix/Office2010"
export WINEDEBUG="-all"
#POL_Log=Microsoft Office 2010_1336312516
cd "/home/leo/.PlayOnLinux//wineprefix/Office2010/drive_c/./Program Files/Microsoft Office/Office14"
POL_Wine "EXCEL.EXE" $@
In the end change $@
to
"$(echo "$@" | sed -e 's:/*/:\\:g')"
(leave " in!!) You have to do this with every application you want to set associations to.
Now go to the file you want to open click open with and other applications then show other applications and you should see word and powerpoint. Click on it and is should start. You have to repeat this with all the apps you want to set associations to.
Hope it will work!
Update: PlayOnLinux have finally added this feature so you do not need to do this manually any more! But you still have to add "$(echo "$@" | sed -e 's:/*/:\\:g')"
in the end.
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.
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
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
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
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.
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
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.
Optional: Restart the computer just to be extra careful.
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.
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
.
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.
In POL, select Configure
to enter the configuration screen and then click New
in the bottom left to start the Virtual drive creator.
Select 32 bits windows installation and press Next
.
Select Wine version 3.4 and press Next
.
Give the virtual drive a name (eg Office2016pp
) and press Next
to start the creation. Select to install Mono if POL asks.
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.
Click on the Install components tab at the top. Then scroll down to select msxml6
and click Install
.
Repeat above step to install component riched20
.
Select the Wine
tab in the POL Configuration screen and then click on Configure Wine
.
Once the Wine Configuration screen appears, click on the Libraries
tab. Click Edit to change both msxml6 and riched20 to (native, builtin).
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.
Select the Wine
tab in the POL Configuration screen and then click on Registry Editor
to open the Registry Editor.
Select to HKEY_CURRENT_USER
->Software
->Wine
and
Click Edit
->New
->Key
and name this key Direct2D
.
Select Direct2D
and then Edit
->New
->DWORD Value
named max_version_factory
with a value of 0
.
- Close the Registry Editor and return to the POL Configuration screen.
Install Office
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.
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.
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.
Once the installation is complete, close the POL configuration screen to exit to the main POL screen.
In the main POL screen, click Tools
->Close all PlayOnLinux software
.
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.
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.
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/
.
Close Nautilus and go back to the POL configuration screen.
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.
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.
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.
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.
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
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;
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.
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
Optional: Install Office 2016 updates. This is still a work in progress. Watch this post for updates.
Best Answer
First of all, you need to have PlayOnLinux 4.1.1 (It won't work with 4.0.x)
To upgrade PlayonLinux to latest version, go to this link : http://www.playonlinux.com/en/download.html
Choose ubuntu, and follow the instructions regarding your distribution.
Then go to PlayOnLinux options -> File associations (.docx -> Microsoft Word 2010) You need to enter separately each file type (xls,xlsx,dox,docx) and to associate it with the corresponding office program.
Then, tell Ubuntu to open .docx files with playonlinux. (you can do this by the usual icon right click)
If you want to make the opening of office files permanent, with MS Office, you should right click on a .doc, .docx,... and go to properties-> open with-> playonlinux set as default. You have to do this separately for each file type.