如何在 PlayOnLinux 上安装 MS Office 2016

C.D*_*tis 20 wine playonlinux microsoft-office

如何让playonlinux安装 Microsoft Office 2016。安装菜单中的选项最多只能到 2013。

是否有更新版本的PlayOnLinux(或确实是Wine)我可以下载以启用 MS Office 2016 的安装?

我采取的步骤是:

  1. 打开 PlayOnLinux
  2. 点击安装
  3. 单击 Office
    返回多个软件包的列表,包括 MS Office 2007、2010 和 2013(但 2016 年不是)

Jay*_*Din 15

我将提供对我使用PlayOnLinux (POL) v4.3.4Wine x86 v3.4在 Ubuntu 18.04 上手动(非脚本)安装Microsoft Office 2016 Professional Plus 的指导。除了 OneNote 之外的所有应用程序都打开了,虽然我只真正使用过 Word 和 Excel,所以我不能说其他应用程序的功能。

显示 Office 2016 应用程序的 PlayOnLinux

首先,尝试这里的默认 POL 脚本和/或其他一些脚本来检查它们是否有效,因为这会为您节省大量时间和麻烦。

我尝试了 POL 附带的默认脚本以及此处提供的一些其他脚本,但它们卡住了(例如 Office 安装未完成)或在各个点崩溃(例如“找不到文件”错误)。下面的手动过程基本上复制了这些脚本,这个手动过程的优点是您可以准确地看到您的特定设置可能遇到问题的位置。

这些说明的一部分基于GlasierXplor 的 POL 论坛帖子以及此处的其他答案。


准备工作

  1. 依赖安装:根据POL的网站,wine:i386需要安装。如果您尝试apt-get install wine:i386,它将失败,因为它绑定到 2 个包。在 之上wine:i386,您将需要smbclientwinbind以启动 Office。

    • 注意:请勿使用--no-install-recommends安装wine-stable,因为它会导致 Office 安装由于缺少某些依赖项而始终崩溃(无法确定哪些包)。

    • 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. 可选:将 POL 更新最新版本。这是因为有一次 POL 给出了一个错误,表明需要更新,一旦我升级到 POL v4.3.4,这个错误就消失了。以下是 Ubuntu 18.04(仿生)说明:

    • 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. 可选:如果您没有或没有 CD,请下载 Office 2016 安装文件。您可以使用以下选项之一从 MS 下载它。我假设您已经在本答案的其余部分下载了Office 2016 Pro Plus版本。

  4. 可选:安装 winetricks 和 mono。我从之前尝试过的脚本中收到了与 winetricks 和 mono 相关的各种错误,因此在尝试手动安装时我已经安装了这些错误。不确定安装这些是否有任何不同,因此您可以先尝试下面的手动安装步骤,如果遇到错误,然后再回到此步骤。

    • sudo apt-get install winetricks
    • winetricks dotnet45
  5. 可选:删除以前在 POL 上安装不成功的 Office 2016。如果您尝试使用脚本进行安装,则可能存在空安装或部分安装的 POL 虚拟驱动器。在尝试以下安装过程之前,您可能需要移除这些驱动器。

  6. 可选:重新启动计算机只是为了格外小心。

  7. 注意在您的计算机使用多台显示器的任何情况下,如果出现以下情况,Office 将无法正确显示:-

    • 使用附加显示器启动 Office
    • 关闭办公室
    • 断开任何其他显示器
    • 开始办公

    Office 会以限制在主显示器左上角的最大尺寸开始,并拒绝尊重桌面的尺寸,直到您再次连接“正确”数量的显示器。在这种情况下,Office 将再次正常(主观)行事。

    例如

    • 安装带有 2 个显示器的办公室
    • 用 3 个显示器启动办公室
    • 关闭办公室并断开任意数量的显示器(例如离开 1 个显示器)
    • 重新开始办公室。Office 将从主显示器的左上角开始。
    • 将 1 个显示器连接到您的计算机(所以现在我们有 2 个显示器)。
    • 重新开始办公室。Office 仍会从主显示器的左上角开始。
    • 只有在任何时间点连接了最大数量的启动 Office 的显示器(在本例中为 3 个显示器)时,Office 才会正常运行

设置 POL

考虑:Wine x86 4.15 版比 3.4(下文)或 3.14(GlasierXplor 在 POL 论坛上的帖子)更稳定。即它不会随机崩溃。需要注意的是,图像会有一些问题,但在 97% 的情况下应该可以正常工作。Wine 4.15 需要安装来自官方 POL 存储库的 POL 4.3.4 更新。

  1. Wine x86 3.4 版用于此安装,因此通过启动 POL 然后选择Tools->来检查它是否已安装Manage Wine Versions安装了 x86 版本 3.4 的“管理 Wine 版本”窗口

  2. 如果“已安装的Wine 版本”下没有出现Wine x86 版本3.4,则从“可用的Wine 版本”窗口中选择它,然后单击>中间的进行安装。安装后,关闭并退出到主 POL 菜单。

  3. 在 POL 中,选择Configure进入配置屏幕,然后单击New左下角的 启动 Virtual drive creator。

  4. 选择 32 位 windows 安装,然后按NextPlay On Linux 32 32 位 windows 安装

  5. 选择 Wine 3.4 版并按Next

  6. 为虚拟驱动器命名(例如Office2016pp),然后按Next开始创建。如果 POL 询问,则选择安装 Mono。

  7. 虚拟驱动器创建完成后,您应该返回主 POL 配置屏幕。确保在Office2016pp左侧窗口中选择了新创建的驱动器(例如)。

  8. 单击顶部的安装组件选项卡。然后向下滚动以选择msxml6并单击Install

POL 安装组件 msxml6

  1. 重复以上步骤安装组件riched20

  2. 选择WinePOL 配置屏幕中的选项卡,然后单击Configure Wine

  3. 出现 Wine 配置屏幕后,单击Libraries选项卡。单击“编辑”将 msxml6 和riched20 更改为(本机、内置)。 Wine 配置编辑库

  4. 在 Wine 配置屏幕中,单击Applications选项卡并确保将Windows 7其选为 Windows 版本。退出到 POL 配置屏幕。

  5. 选择WinePOL 配置屏幕中的选项卡,然后单击Registry Editor打开注册表编辑器。

  6. 选择HKEY_CURRENT_USER-> Software->Wine

  7. 单击Edit-> New->Key并命名该键Direct2D

  8. 选择Direct2D然后Edit-> New->DWORD Value命名max_version_factory0.

在此处输入图片说明

  1. 关闭注册表编辑器并返回到 POL 配置屏幕。

安装办公室

  1. 插入安装盘或挂载Office 2016 安装镜像文件(如ProPlusRetail.img)。双击 Nautilus 上的图像文件应该会自动挂载它。

  2. 在 Pol 配置屏幕中,单击Miscellaneous选项卡,然后单击Run a .exe file in this virtual drive打开选择文件菜单。

  3. 在“选择文件”菜单中,选择Setup32.exeOffice 2016 驱动器(例如在Office文件夹中)以启动 Office 2016 安装过程。希望它能够正确安装并退出而没有任何错误。

  4. 安装完成后,关闭 POL 配置屏幕以退出到主 POL 屏幕。

  5. 在 POL 主屏幕中,单击Tools-> Close all PlayOnLinux software

  6. 在主 POL 屏幕中,单击Configure以转到 POL 配置菜单并选择Office2016pp(或您使用的任何名称)左侧的驱动器。

  7. 在 Pol 配置屏幕中,单击Miscellaneous选项卡并单击Open virtual drive's directory打开一个新的 Nautilus(“文件”)窗口。

  8. 使用 Nautilus 转到文件夹drive_c/Program Files/Common Files/Microsoft Shared/ClickToRun/并复制AppvIsvSubsystems32.dll并复制C2R32.dlldrive_c/Program Files/Microsoft Office/root/Office16/.

Nautilus ClickToRun 文件夹视图

  1. 关闭 Nautilus 并返回到 POL 配置屏幕。

  2. 在 Pol 配置屏幕中,单击General选项卡并单击Make a new shortcut from this virtual drive以启动 POL 向导以创建指向 Office 应用程序的链接。

POL 创建应用链接

  1. 您需要为每个办公应用程序选择可执行文件并命名链接。请注意,其中一些应用程序(例如 OneNote)可能根本无法运行。

    • 选择文件WINWORD.EXE并命名链接Microsoft Word 2016
    • 选择文件EXCEL.EXE并命名链接Microsoft Excel 2016
    • 选择文件POWERPNT.EXE并命名链接Microsoft Powerpoint 2016
    • 选择文件MSACCESS.EXE并命名链接Microsoft Access 2016
    • 选择文件OUTLOOK.EXE并命名链接Microsoft Outlook 2016
    • 选择文件ONENOTE.EXE并命名链接Microsoft OneNote 2016
    • 选择I don't want to make another shortcut退出向导。
  2. 关闭 POL 配置屏幕以退出到主 POL 屏幕。您现在应该会在主 POL 屏幕中看到您现在链接到的应用程序。

显示 Office 2016 应用程序的 PlayOnLinux

  1. 双击 POL 内的 MS Word 运行它,您将被要求激活 Office。完成后,关闭 Word 并关闭 POL。

  2. 您还应该为桌面上的每个办公应用程序找到新的 .desktop 文件。~/.local/share/applications如果您希望它们出现在 Ubuntu dash 和“选择应用程序”菜单中,您可以使用 Nautilus 将这些文件复制或移动到其中。


安装后

  1. 可选:将类别插入到 .desktop 文件中。编辑每个 .desktop 文件并输入类别信息以帮助搜索。您可以通过右键单击每个文件 -> Open with other Application-> 来编辑它Text Editor

    • Microsoft Word 2016.desktop 更新 Categories=Office;WordProcessor;
    • Microsoft Excel 2016.desktop 更新 Categories=Office;Spreadsheet;
    • Microsoft Powerpoint 2016.desktop 更新 Categories=Office;Presentation;
    • Microsoft Access 2016 更新 Categories=Office;Database;
    • Microsoft Outlook 2016 更新 Categories=Network;Email;
    • Microsoft OneNote 2016 更新 Categories=Office;WordProcessor;
  2. 可选:更新 POL 的扩展文件. 启动 POL 并单击Setting屏幕左侧的操作下。然后将扩展程序和程序关联起来,如下所示。

POL 扩展

  1. 可选:将 Office .desktop 文件设置为受信任以避免“不受信任的应用程序启动器”警告。只有在它引起问题时才需要这样做。

    • 打开一个shell~/.local/share/applications并输入:
    • 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. 可选:安装 Office 2016 更新。这仍然是一项正在进行的工作。观看此帖子以获取更新。


N0r*_*ert 5

下面是 PlayOnLinux 的 Office 2016 脚本的第一个版本(基于 Office 2013 one)。

它使用 Wine 3.0,但有时在尝试调用在 32 位代码中调用的未实现函数 KERNEL32.dll.FindNLSStringEx时会在 Office 欢迎屏幕上崩溃
所以我们需要 Wine 3.4+,但我无法在我的 Ubuntu 16.04 LTS 上运行这个脚本。

确实需要更有经验的用户的测试和帮助。

剧本:

#!/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
Run Code Online (Sandbox Code Playgroud)

应将其保存为pol-mso2016.sh,然后通过选择工具 -> 运行本地脚本将其加载到 PlayOnLinux 中,然后按照屏幕上的说明进行操作。