使用OfficeDeploymentTool工具离线下载安装Office

文章目录

OfficeDeploymentTool(ODT)是一款命令行工具,可以使用它下载并将 Microsoft 365 应用版部署到客户端计算机。ODT可以更好地控制Office 安装:可以定义要安装哪些产品和语言、应该如何更新这些产品以及是否向用户显示安装体验。

Microsoft 下载中心下载Office部署工具。这将得到一个officedeploymenttool_14326-20404.exe文件。这是一个自解压可执行文件。

双击运行它,在弹出的对话框中指定一个空的文件夹,例如D:\OfficeDeploymentTool。执行完成之后,在这个文件夹中将出现1个setup.exe文件和4个*.xml文件。

在这里插入图片描述
setup.exe是Office部署工具可执行文件,*.xml文件是示例配置文件。其中,

  1. configuration-Office365-x64.xml文件用于安装Microsoft 365 Apps for enterprise版本
  2. configuration-Office2021Enterprise.xml文件用于安装Microsoft 365 Apps for business版本

配置

对于个人用户,推荐安装Microsoft 365 Apps for enterprise。

  1. 用记事本打开configuration-Office365-x64.xml文件。
  2. <Language>标签的ID属性修改成zh-cn

如下所示:

<!-- Office 365 client configuration file sample. To be used for Office 365 ProPlus apps, 
     Office 365 Business apps, Project Pro for Office 365 and Visio Pro for Office 365. 

     For detailed information regarding configuration options visit: http://aka.ms/ODT. 
     To use the configuration file be sure to remove the comments

     The following sample allows you to download and install the 64 bit version of the Office 365 ProPlus apps 
     and Visio Pro for Office 365 directly from the Office CDN using the Current Channel
     settings  -->

<Configuration>

  <Add OfficeClientEdition="64" Channel="Current">
    <Product ID="O365ProPlusRetail">
      <Language ID="zh-cn" />
    </Product>
    <Product ID="VisioProRetail">
      <Language ID="zh-cn" />
    </Product>
  </Add>

  <!--  <Updates Enabled="TRUE" Channel="Current" /> -->

  <!--  <Display Level="None" AcceptEULA="TRUE" />  -->

  <!--  <Property Name="AUTOACTIVATE" Value="1" />  -->

</Configuration>

下载

按住Shift键之后,鼠标右击,选择“在此处打开 Powershell 窗口”。

在这里插入图片描述

在打开的Powershell窗口中,输入下列代码下载office:

.\setup.exe /download configuration-Office365-x64.xml

如果Powershell没有任何提示,表示下载成功。

安装

接下来,就可以安装office。同样也是一行命令行代码:

.\setup.exe /configure configuration-Office365-x64.xml

这将打开一个setup.exe窗口,开始安装office。如果Powershell没有任何提示,表示安装成功!

在这里插入图片描述