add checks for free disk space
This commit is contained in:
@@ -64,6 +64,8 @@ With `ValidateBeforeChanges=true`, the script checks the subscription/activation
|
||||
|
||||
Validation writes logs and staging files in the execution account's temp directory, secures its workspace, and runs ODT extraction and `/download` when no reusable cache exists; it is not a zero-write inventory scan. Allow several GB for the first run. It registers no scheduled tasks. A later `false` run repeats prerequisites and reuses matching, unexpired media after checking its file inventory, sizes, and Microsoft executable signatures. The script does not calculate or compare file checksums. The small user cleanup helper is always refreshed from the repository and is deleted from the validation workspace before returning. Validation does not prove tenant entitlements, successful future uninstallation/activation, or availability of the online companion payloads at install time.
|
||||
|
||||
Disk-space checks reserve **10 GB for installation and companion apps**, plus **6 GB for a fresh media download** on the staging drive. When staging, Windows, and Program Files share C:, this means 16 GB free before a fresh download and 10 GB remaining after staging. A cache hit only needs the installation reserve. Windows and Program Files volumes are checked separately when they differ. Both validation and deployment check again after staging, before app shutdown/removal, so a completed download cannot pass validation with too little space left to install. These are adjustable deployment headroom values in `Get-OfficeDeploymentDefinitions`, not Microsoft's minimum system requirements or a guarantee against concurrent disk use. A space failure reports the drive, available space, and requirement; it preserves staged media for reuse after space is freed. It does not delete unrelated files or add housekeeping tasks.
|
||||
|
||||
The script resolves the current versioned ODT download from the [Microsoft Download Center](https://www.microsoft.com/en-us/download/details.aspx?id=49117). It does not depend on the Emberkom-hosted setup.exe or a frozen Microsoft binary URL. If the page format changes, it stops before removal. The downloaded ODT package and extracted setup.exe must have valid Microsoft signatures.
|
||||
|
||||
**Unattended deployment does not download or launch Get Help.** The Get Help build observed on October 14, 2026 created an elevated PowerShell cleanup window in the logged-in user's session even when its parent ran hidden under SYSTEM. Hiding the parent did not hide that child, and Microsoft's documented `-HideProgress` option applies to other scenarios, not Office removal. See the [Get Help command-line reference](https://learn.microsoft.com/en-us/troubleshoot/microsoft-365/admin/miscellaneous/get-help-command-line-overview). The script uses ODT's supported silent removal instead; an interactive scrub is an attended troubleshooting step only.
|
||||
@@ -152,6 +154,10 @@ Earlier ProgramData caches are not searched for reuse in the new temp location.
|
||||
|
||||
Syncro may flag nonzero results as errors; read the printed status, pending SIDs, and task registration failures. Schedule any required restart separately. The script also returns `3010` after verified legacy MSI Office removal, following Microsoft's restart requirement.
|
||||
|
||||
ODT's redirected `stdout`/`stderr` files can be empty even when installation fails. Microsoft writes native setup/Click-to-Run logs in the execution account's temp directory and `C:\Windows\Temp`; SYSTEM's temp may be `C:\Windows\SystemTemp`. On an ODT failure, the script searches those folders for recent, nonempty Office/setup or computer-name logs and appends bounded error excerpts and their full paths to the existing Tools diagnostic log. Look for `Native Office log:` and `Native Office detail:`. Collection is read-only, creates no task or additional resident helper, and cannot override the original installer exit code. Excerpts are clues; retain the full native logs when diagnosing a failure.
|
||||
|
||||
Exit `17004` is documented as `ERROR_COMPLETING_SCENARIO_NEED_CLEAN_UP`, with possible reasons including unknown SKUs or unavailable CDN content. It does not establish that an old Office installation needs a scrub. Inspect the native error details before changing removal behavior or repeating a destructive deployment. See [Microsoft's Office CSP error table](https://learn.microsoft.com/en-us/windows/client-management/mdm/office-csp) and [ODT troubleshooting log locations](https://learn.microsoft.com/en-us/microsoft-365-apps/deploy/deploy-microsoft-365-apps-local-source).
|
||||
|
||||
If machine companion removal still fails verification, the error identifies the remaining component, version, and registry location, along with the uninstall log folder. The main log also records which add-in registrations were left to user cleanup. An uninstall exit code of `1605` alone does not establish that all users' installations are gone; Windows Installer context determines which stage handles the add-in. This failure occurs before Office removal, identity reset, and reinstallation, but companion apps may already have been removed.
|
||||
|
||||
The main script uses the overridden `Write-Output` and `Write-Error` from `Tools.ps1` for actions, retries, failures, and the final receipt, writing to its existing `$Global:LogFile`. Internal action messages suppress the logger's echoed success output to keep function results separate from diagnostics. The mode notice, log location, and final receipt use `Microsoft.PowerShell.Utility\Write-Output` for Syncro. Errors are logged and also printed to Syncro. Native PowerShell relaunch reloads Tools and restores the caller's log path. Run the core through the shim/Tools execution context, not as an independent file without Tools.
|
||||
|
||||
Reference in New Issue
Block a user