Installing Office into Windows Container (servercore:ltsc2019) failed with error code 17002

1

Error Message

ODT (Office Deployment Tool) log reported error when installing into Windows Container (Server Core): C2R client returned failing error code, error code: 17002

Environments

  • Behavior in Windows Server 2019 (1809) with Desktop Experience installed.
    • ODT installation Result: Succeeded.
    • test-o365.ps1: Succeeded.
  • Behavior in Container (mcr.microsoft.com/windows/servercore:ltsc2019)
    • ODT installation Result: Negative (C2R client returned failing error code, error code: 17002)
    • test-o365.ps1: Negative: HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)

Dockerfile

FROM mcr.microsoft.com/windows/servercore:ltsc2019
WORKDIR C:/setup
COPY . . 
ENTRYPOINT startup.cmd

startup.cmd

curl.exe https://download.microsoft.com/download/2/7/A/27AF1BE6-DD20-4CB4-B154-EBAB8A7D4A7E/officedeploymenttool_12325-20288.exe  --output .\
officedeploymenttool_12325-20288.exe
officedeploymenttool_12325-20288.exe /quiet /passive /extract:.
setup.exe /configure o365.xml
powershell -file test-o365.ps1
pause

o365.xml

<Configuration>
  <Add OfficeClientEdition="64" Channel="Monthly">
    <Product ID="O365ProPlusRetail">
      <Language ID="en-us" />
    </Product>
  </Add>
  <!--  <Updates Enabled="TRUE" Channel="Monthly" /> -->
  <Display Level="None" AcceptEULA="TRUE" />
  <Logging Level="Standard" Path="." />
  <!--  <Property Name="AUTOACTIVATE" Value="1" />  -->
</Configuration>

test-o365.ps1

# Write current datetime into result.xlsx to verify that Office COM component is working.
$filename = [System.Environment]::CurrentDirectory + "\result.xlsx"
$filename
if ([System.IO.File]::Exists($filename )) {    
    Remove-Item $filename 
}
$xl=New-Object -ComObject Excel.Application
$xl.Visible=$false
$wb=$xl.WorkBooks.Add()
$ws=$wb.WorkSheets.item(1)
$ws.Cells.Item(1,1)= [System.DateTime]::Now
$wb.SaveAs($filename)
$xl.Quit()

More information

We are already aware of 'server-side Automation of Office' issues as mentioned in article [3]. At current stage, we are evaluating the possibility on running legacy ASP.NET application in Windows container, with Office/COM inter-operation enabled.

References

  1. Overview of the Office Deployment Tool
  2. What is the Server Core installation option in Windows Server?
  3. Considerations for server-side Automation of Office
.net
azure
docker
containers
odt
asked on Stack Overflow Mar 31, 2020 by Kai Wang

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0