Deploy Click-to-Run for Office 365 products by using the Office Deployment Tool

Office Deployment Tool (ODT) is a command line tool that can be used to download the source file and install to local machine. The basic steps are:

  1. Download the ODT: https://www.microsoft.com/en-us/download/details.aspx?id=49117
  2. Use the ODT to download the source file to a shared folder ( /download )
  3. Use the ODT to install the Office 365 on the target PCs from the shared folder (/configure), this step can be finished via script to automate the installation process.

We will talk about step 2 and 3 bellow:

Download the source file to a local shared folder

Create a customized Configuration.xml file to specify which Click-to-Run for Office 365 products and languages to deploy.

The download of the Office Deployment Tool includes a sample configuration file, Configuration.xml, which you can customize. To customize this file, use any text editor, such as Notepad.

Edit the sample Configuration.xml file and provide the options to use to deploy the Click-to-Run for Office 365 programs and languages.

For more information about which options to use, see Overview: Office Deployment Tool and Reference: Configuration options for the Office Deployment Tool.

For example, if you want to install the 32-bit edition of Office 365 ProPlus in English (US) from a network share of \\server01\office, your Configuration.xml file will include the following code:

<Configuration>

  <Add SourcePath="E:\office365\" OfficeClientEdition="32" Channel="Deferred" AcceptEULA="TRUE">
    <Product ID="O365ProPlusRetail">
      <Language ID="en-us" />
    </Product>
    </Product>
  </Add>
  
  

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

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

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

</Configuration>

The Product ID:

Office 365 plan Product ID
Office 365 ProPlus
Office 365 Enterprise E3
Office 365 Enterprise E4
Office 365 Enterprise E5
Office 365 Midsize
O365ProPlusRetail
Office 365 Business
Office 365 Business Premium
O365BusinessRetail
Office Small Business Premium O365SmallBusPremRetail

Save the Configuration.xml file. For example, save the file as deployconfigfile.xml.

To download Office 365 ProPlus Click-to-Run sources, use the /download command as in the following example:

  • \\server\Office15\setup.exe /download \\server\Office15\Customconfigfile.xml   where:
    • \\server\Office15 in this example is the network share location that contains the Office Deployment Tool and the custom Configuration.xml file, Customconfigfile.xml
    • setup.exe is the Office Deployment Tool executable
    • /download downloads the Office 365 ProPlus Click-to-Run source files that you specify in the custom Configuration.xml file

 

 install the Office 365 on the target PCs from the shared folder (/configure)

 

On the computer on which you want to install Click-to-Run for Office 365 products, log on as a user who is a local administrator on the computer, and then run the following command:

\\server01\Office\setup.exe /configure \\server01\office\deployconfigfile.xml

where:

  • \\server01\Office is the network share (in this example) that contains the Office Deployment Tool and the customized Configuration.xml file (in this example, deployconfigfile.xml)
  • Setup.exe is the Office Deployment Tool executable
  • /configure is the Office Deployment Tool command that is used to perform an installation

Note that there is no progress bar, wait for the installation to complete.

Remove or update Click-to-Run for Office 365 products

You can also use the Office Deployment Tool with the /configure option and a customized Configuration.xml file to remove or update Click-to-Run for Office 365 products and languages.

To remove Click-to-Run for Office 365 products and languages, you use the Remove element in a customized Configuration.xml file. For example, if you want to remove an installation of Office 365 ProPlus in Japanese, your Configuration.xml file will include the following code:

<Configuration>
 <Remove>
 <Product ID="O365ProPlusRetail" >
 <Language ID="ja-jp" />
 </Product>
 </Remove>
 </Configuration>

To configure the update behavior for Click-to-Run for Office 365 products and languages, you use the Updates element in a customized Configuration.xml file when you deploy the Click-to-Run for Office 365 products and languages. For example, if you want to enable updates from a network share of \\server01\updates, your Configuration.xml file will include the following code:

<Updates Enabled = “TRUE” UpdatePath=”\\server01\updates”>

Advanced installation (deploy via group policy)

 

Now If you want to install office on new machine:

First create the auto_setup script:

 

@echo off
setup.exe /configure configuration.xml

If you want to make the script bit of smarter, and check if you have installed the office 365, then use following command:

 
setlocal 
REM ********************************************************************* 
REM Environment customization begins here. Modify variables below. 
REM ********************************************************************* 
REM Set DeployServer to a network-accessible location containing the Office source files. 
set DeployServer=\\server\Software\Office365ProPlus
REM Set ConfigFile to the configuration file to be used for deployment (required) 
set ConfigFile=\\server\Software\Office365ProPlus\config.xml
REM Set LogLocation to a central directory to collect script log files (install log files are set in XML file). 
set LogLocation=\\server\InstallLogs\Office365ProPlus
REM ********************************************************************* 
REM Deployment code begins here. Do not modify anything below this line (check quotes are quotes though). 
REM ********************************************************************* 
IF NOT "%ProgramFiles(x86)%"=="" (goto ARP64) else (goto ARP86) 
REM Operating system is X64. Check for 32 bit Office in emulated Wow6432 registry key 
:ARP64 
reg query HKLM\SOFTWARE\WOW6432NODE\Microsoft\Office\15.0\ClickToRun\propertybag 
if NOT %errorlevel%==1 (goto End) 
REM Check for 32 and 64 bit versions of Office 2013 in regular registry key.(Office 64bit would also appear here on a 64bit OS) 
:ARP86 
reg query HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\propertybag 
if %errorlevel%==1 (goto DeployOffice) else (goto End) 
REM If 1 returned, the product was not found. Run setup here. 
:DeployOffice 
echo %date% %time% Setup started. >> %LogLocation%\%computername%.txt 
pushd "%DeployServer%"
start /wait setup.exe /configure "%ConfigFile%"
echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt 
REM If 0 or other was returned, the product was found or another error occurred. Do nothing. 
:End
Endlocal

Then set a startup script in group policy, the location is Computer Configuration > Policies > Windows Settings >Scripts > Startup, and point to the file you created above,Note that use the UNC path to make sure every computer can find the script.

Reference

https://technet.microsoft.com/en-au/library/jj219423.aspx

Configuration file option: https://technet.microsoft.com/en-au/library/jj219426.aspx

Component (Product ID): https://support.microsoft.com/en-us/help/2842297/product-ids-that-are-supported-by-the-office-deployment-tool-for-click-to-run

Deploy the Office365 via group policy.