open-circle-ltd / chocolatey.microsoft-office-deployment

Microsoft Office Deployment Packages for Chocolatey
MIT License
14 stars 11 forks source link

exit code 17002 on run 'choco upgrade microsoft-office-deployment --yes --no-progress --params "/Product=Excel2019Volume /Exclude=Access,Publisher,PowerPoint,OneDrive,Outlook,OneNote,Skype,Teams,Groove,Word /DisableUpdate=TRUE"' #11

Closed ThomasPatzig closed 1 year ago

ThomasPatzig commented 3 years ago

got this error log output:

run 'choco upgrade microsoft-office-deployment --yes --no-progress --params "/Product=Excel2019Volume /Exclude=Access,Publisher,PowerPoint,OneDrive,Outlook,OneNote,Skype,Teams,Groove,Word /DisableUpdate=TRUE"'

Chocolatey v0.10.15
Upgrading the following packages:
microsoft-office-deployment
By upgrading you accept licenses for the packages.
microsoft-office-deployment is not installed. Installing...

microsoft-office-deployment v16.0.13628.20274
microsoft-office-deployment package files upgrade completed. Performing other installation steps.
Installing 32-bit version.
Update Disabled
Installation Product Excel2019Volume
Excluded Access
Excluded Publisher
Excluded PowerPoint
Excluded OneDrive
Excluded Outlook
Excluded OneNote
Excluded Skype
Excluded Teams
Excluded Groove
Excluded Word
Using system proxy server '<proxy>:8080'.
File appears to be downloaded already. Verifying with package checksum to determine if it needs to be redownloaded.
Hashes match.
Hashes match.
Installing Office-Deployment-Tool...
Office-Deployment-Tool has been installed.
Installing microsoft-office-deployment...
ERROR: Running ["C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\setup.exe" /configure C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\Install.xml ] was not successful. Exit code was '17002'. See log for possible error messages.
The upgrade of microsoft-office-deployment was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\chocolateyinstall.ps1'.
 See log for details.

Chocolatey upgraded 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - microsoft-office-deployment (exited 17002) - Error while running 'C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\chocolateyinstall.ps1'.
 See log for details.

...and this detailed log: have just replaced my user name by <user>

2021-03-08 12:32:10,009 7716 [INFO ] - Installing Office-Deployment-Tool...
2021-03-08 12:32:10,150 7716 [DEBUG] - Error ensuring directories exist -  Exception calling "GetDirectoryName" with "1" argument(s): "The path is not of a legal form."
2021-03-08 12:32:10,199 7716 [DEBUG] - Running Start-ChocolateyProcessAsAdmin -validExitCodes '0 3010 2147781575 2147205120' -workingDirectory 'C:\Users\<user>\AppData\Local\Temp\chocolatey\microsoft-office-deployment\16.0.13628.20274' -statements '/extract:C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin /log:C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\logs\Office-Deployment-Tool.log /quiet /norestart ' -exeToRun 'C:\Users\<user>\AppData\Local\Temp\chocolatey\microsoft-office-deployment\16.0.13628.20274\officedeploymenttool_13628-20274.exe' 
2021-03-08 12:32:10,201 7716 [DEBUG] - Unable to use current location for Working Directory. Using Cache Location instead.
2021-03-08 12:32:10,237 7716 [DEBUG] - Test-ProcessAdminRights: returning True
2021-03-08 12:32:10,243 7716 [DEBUG] - Elevating permissions and running ["C:\Users\<user>\AppData\Local\Temp\chocolatey\microsoft-office-deployment\16.0.13628.20274\officedeploymenttool_13628-20274.exe" /extract:C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin /log:C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\logs\Office-Deployment-Tool.log /quiet /norestart ]. This may take a while, depending on the statements.
2021-03-08 12:32:11,987 7716 [DEBUG] - Command ["C:\Users\<user>\AppData\Local\Temp\chocolatey\microsoft-office-deployment\16.0.13628.20274\officedeploymenttool_13628-20274.exe" /extract:C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin /log:C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\logs\Office-Deployment-Tool.log /quiet /norestart ] exited with '0'.
2021-03-08 12:32:11,994 7716 [DEBUG] - Finishing 'Start-ChocolateyProcessAsAdmin'
2021-03-08 12:32:11,995 7716 [INFO ] - Office-Deployment-Tool has been installed.
2021-03-08 12:32:12,014 7716 [DEBUG] - Running Install-ChocolateyInstallPackage -silentArgs '/configure C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\Install.xml' -file 'C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\setup.exe' -fileType 'EXE' -validExitCodes '0 3010 2147781575 2147205120' -packageName 'microsoft-office-deployment' 
2021-03-08 12:32:12,015 7716 [DEBUG] - Running Get-ProcessorBits -compare '32' 
2021-03-08 12:32:12,016 7716 [INFO ] - Installing microsoft-office-deployment...
2021-03-08 12:32:12,020 7716 [DEBUG] - Error ensuring directories exist -  Exception calling "GetDirectoryName" with "1" argument(s): "The path is not of a legal form."
2021-03-08 12:32:12,021 7716 [DEBUG] - Running Start-ChocolateyProcessAsAdmin -validExitCodes '0 3010 2147781575 2147205120' -workingDirectory 'C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin' -statements '/configure C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\Install.xml ' -exeToRun 'C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\setup.exe' 
2021-03-08 12:32:12,021 7716 [DEBUG] - Unable to use current location for Working Directory. Using Cache Location instead.
2021-03-08 12:32:12,022 7716 [DEBUG] - Test-ProcessAdminRights: returning True
2021-03-08 12:32:12,023 7716 [DEBUG] - Elevating permissions and running ["C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\setup.exe" /configure C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\Install.xml ]. This may take a while, depending on the statements.
2021-03-08 12:32:31,149 7716 [DEBUG] - Command ["C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\setup.exe" /configure C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\Install.xml ] exited with '17002'.
2021-03-08 12:32:31,166 7716 [ERROR] - ERROR: Running ["C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\setup.exe" /configure C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\..\bin\Install.xml ] was not successful. Exit code was '17002'. See log for possible error messages.
2021-03-08 12:32:31,169 7716 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\microsoft-office-deployment\tools\chocolateyinstall.ps1' -installArguments '' -packageParameters '/Product=Excel2019Volume /Exclude=Access,Publisher,PowerPoint,OneDrive,Outlook,OneNote,Skype,Teams,Groove,Word /DisableUpdate=TRUE''] exited with '17002'.
ThomasPatzig commented 3 years ago

maybe this path combine is the root cause:

$binDir = "$($toolsDir)\..\bin"
$logDir = "$($toolsDir)\..\logs"

and can be solved by this:

$binDir = [System.IO.Path]::GetFullPath("$($toolsDir)\..\bin")
$logDir = [System.IO.Path]::GetFullPath("$($toolsDir)\..\logs")
ThomasPatzig commented 3 years ago

have identify the root cause: choco uninstall of this package doesn't work!

it must be uninstalled with "OfficeClickToRun" at first:

"C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeClickToRun.exe" scenario=install scenariosubtype=uninstall platform=x86 version.16=16.0 culture=en-us productstoremove=ProPlus2019Volume.16_en-us_x-none DisplayLevel=False

or

"C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeClickToRun.exe" scenario=install scenariosubtype=uninstall platform=x86 version.16=16.0 culture=en-us productstoremove=Excel2019Volume.16_en-us_x-none DisplayLevel=False

or

"C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeClickToRun.exe" scenario=install scenariosubtype=uninstall platform=x86 version.16=16.0 culture=en-us productstoremove=(whatever).16_en-us_x-none DisplayLevel=False

then choco uninstall works

and the choco install works again.

ThomasPatzig commented 3 years ago

@sbaerlocher suggestion:

add code to "chocolateyuninstall.ps1" to read current installed product release from registry:

var currentInstalledOffice = registry.TryGetValue<string>(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\Configuration", "ProductReleaseIds");

and run an uninstall of it:

"C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeClickToRun.exe" scenario=install scenariosubtype=uninstall platform=x86 version.16=16.0 culture=en-us productstoremove={currentInstalledOffice}.16_en-us_x-none DisplayLevel=False