Categories
ConfigMgr

ConfigMgr : Multilanguage Office 2016 Click-to-Run (C2R)

Download office using the following configuration.xml file – make sure you include ALL languages you will want to use across devices in your environment – don’t worry though as we’ll use this to stage more streamlined versions as required – the idea here is that you create one source to rule them all – i.e. a single source with all language packs pre-downloaded. More info on how to download here: http://www.cb-net.co.uk/microsoft-articles/34-configmgr/2118-configmgr-deploying-office-2016-click-to-run-during-osd

<Configuration>
  <Add OfficeClientEdition="32" Branch="Current">
    <Product ID="O365ProPlusRetail">
      <Language ID="en-us" />
	  <Language ID="fr-fr" />
	  <Language ID="de-de" />
	  <Language ID="es-es" />
	  <Language ID="pt-pt" />
	  <Language ID="pl-pl" />
	  <Language ID="ro-ro" />
	  <Language ID="ru-ru" />
	  <Language ID="tr-tr" />
    </Product>
  </Add>
  <!--  <Updates Enabled="TRUE" Branch="Current" /> -->
  <!--  <Display Level="None" AcceptEULA="TRUE" />  -->
  <!--  <Property Name="AUTOACTIVATE" Value="1" />  -->
</Configuration>

Now create this dynamic PowerShell script – we’ll call this during OSD or package deployment specifying a argument for the secondary language you need. This script should be named “_Install.ps1” and should be in the root of the package you create, along with the contents of the downloaded Office C2R.

Param(
  [string]$language
)
# Build dynamic XML file text - needed as without specifying the SourcePath Office install hangs
$currentLocation = Split-Path -Parent $MyInvocation.MyCommand.Path;
If ($language) {
$text = @"
<Configuration>
  <Add SourcePath=`"$currentLocation`" OfficeClientEdition=`"32`" Branch=`"Current`">
    <Product ID=`"O365ProPlusRetail`">
      <Language ID=`"en-us`" />
	  <Language ID=`"$language`" />
    </Product>
  </Add>
  <Updates Enabled=`"TRUE`" Branch=`"Current`" />
  <Display Level=`"None`" AcceptEULA=`"TRUE`" />
</Configuration> 
"@
}
Else {
$text = @"
<Configuration>
  <Add SourcePath=`"$currentLocation`" OfficeClientEdition=`"32`" Branch=`"Current`">
    <Product ID=`"O365ProPlusRetail`">
      <Language ID=`"en-us`" />
    </Product>
  </Add>
  <Updates Enabled=`"TRUE`" Branch=`"Current`" />
  <Display Level=`"None`" AcceptEULA=`"TRUE`" />
</Configuration> 
"@
}
# Output XML file
$text | Out-File 'dynamic_configuration.xml'
# Execute setup, using dynamic XML file
start-process -wait -WindowStyle hidden setup.exe -argumentlist "/configure dynamic_configuration.xml"

You can call this from within a ConfigMgr 2012 R2 SP1 Task Sequence using the “Run PowerShell Script” step, configured as below – note I use a TS variable to pass “fr-fr” or “de-de” to the dynamic XML file creation. You could simply type the language needed and work out the logic to get the right package to the right machines a different way.

  • Name: Run Script: Install Microsoft Office C2R (MUI)
  • Script name: _Install.ps1
  • Parameters: -language %OSDSecondaryUILanguage%
  • Execution Policy: Bypass

Leave a Reply

Your email address will not be published. Required fields are marked *