#Requires -Version 5.1 <# JbTecWiz Support Centre -- read-only diagnostic Fault : Office will not install or repair -- 30015, 30088, 30183, 30029-4, 1058-13 Source: https://jbtecwiz.com/support/win-office-install-fail This script CHANGES NOTHING. It runs only the inspection commands from the write-up -- the Get-, Test- and Resolve- calls that establish which cause is in play -- and prints what each returned. Anything that writes, deletes, starts or stops is excluded by construction, not by judgement. Read the output alongside the write-up, then pick the fix that matches. Each fix has its own script on the same page. #> [CmdletBinding()] param([switch]$Transcript) $ErrorActionPreference = 'Continue' if ($Transcript) { $log = Join-Path $env:USERPROFILE ("jbtecwiz-win-office-install-fail-" + (Get-Date -Format yyyyMMdd-HHmmss) + ".txt") Start-Transcript -Path $log | Out-Null Write-Host (' Saving a transcript to ' + $log) } function Write-Rule { param([string]$Text) Write-Host '' Write-Host ('-' * 70) -ForegroundColor DarkGray if ($Text) { Write-Host $Text -ForegroundColor Cyan } } function Probe { param([string]$Label, [string]$Fix, [scriptblock]$Command) Write-Rule (" " + $Label) Write-Host (" from: " + $Fix) -ForegroundColor DarkGray Write-Host '' foreach ($l in ($Command.ToString().Trim() -split "`n")) { Write-Host (" " + $l.Trim()) -ForegroundColor DarkGreen } Write-Host '' try { $out = & $Command 2>&1 | Out-String if ([string]::IsNullOrWhiteSpace($out)) { Write-Host ' (returned nothing)' -ForegroundColor DarkGray } else { foreach ($l in ($out.TrimEnd() -split "`n")) { Write-Host (" " + $l.TrimEnd()) } } } catch { Write-Host (" could not run: " + $_.Exception.Message) -ForegroundColor Yellow } } Write-Rule Write-Host ' Office will not install or repair -- 30015, 30088, 30183, 30029-4, 1058-13' -ForegroundColor White Write-Host ' Read-only diagnostic -- nothing is changed.' -ForegroundColor Green Write-Rule Probe -Label 'Confirm the installed architecture so the repair is told the right one.' -Fix 'Run the repair from the command line, not the Control Panel' -Command { Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration' | Select-Object Platform, ClientVersionToReport, ProductReleaseIds } Probe -Label 'Verify: Every Office application opens and the version reported matches the build you expect.' -Fix 'Run the repair from the command line, not the Control Panel' -Command { Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration' | Select-Object ClientVersionToReport } Probe -Label 'Confirm nothing is left registered before reinstalling.' -Fix 'Remove the remains of the previous install properly' -Command { Test-Path 'HKLM:\SOFTWARE\Microsoft\Office\ClickToRun' } Probe -Label 'Find out which architecture is installed.' -Fix 'Resolve a 32-bit / 64-bit conflict' -Command { Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration' | Select-Object Platform } Probe -Label 'Check for standalone Office products that install separately and pin the architecture -- Project, Visio and the Access Runtime are the usual ones.' -Fix 'Resolve a 32-bit / 64-bit conflict' -Command { Get-Package -Provider Programs -ErrorAction SilentlyContinue | Where-Object Name -match 'Microsoft (Office|365|Project|Visio|Access)' | Select-Object Name, Version } Probe -Label 'Verify: Every Office product opens and reports the same architecture.' -Fix 'Resolve a 32-bit / 64-bit conflict' -Command { Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Office\ClickToRun\Configuration' | Select-Object Platform, ProductReleaseIds } Probe -Label 'Confirm the services the installer depends on are running.' -Fix 'Clear what is blocking the installer itself' -Command { Get-Service ClickToRunSvc, msiserver, BITS, wuauserv | Select-Object Name, Status, StartType } Probe -Label 'Check whether security software quarantined part of the installer, and look at the setup log for the last thing it did.' -Fix 'Clear what is blocking the installer itself' -Command { Get-ChildItem "$env:TEMP" -Filter '*.log' | Where-Object Name -match 'Microsoft Office|SetupExe' | Sort-Object LastWriteTime -Descending | Select-Object -First 3 } Write-Rule Write-Host ' Diagnostic finished. Nothing was changed.' -ForegroundColor Green Write-Host '' Write-Host ' Compare the output above with the write-up, then run the' Write-Host ' script for the fix that matches:' Write-Host ' https://jbtecwiz.com/support/win-office-install-fail' Write-Rule if ($Transcript) { Stop-Transcript | Out-Null }