Fix stale WinGetWin32Apps.json handling

Treat WinGetWin32Apps.json as generated app orchestration output so failed or cancelled builds do not restore stale install metadata. Reuse Apps.iso when app inputs have not changed, and refresh it only when current app content or orchestration inputs are newer.
This commit is contained in:
rbalsleyMSFT
2026-06-04 16:54:16 -07:00
parent 7decd8f1ba
commit c32cb93434
3 changed files with 83 additions and 22 deletions
@@ -69,6 +69,11 @@ function Invoke-FFUPostBuildCleanup {
WriteLog "CommonCleanup: Removing $store"
try { Remove-Item -LiteralPath $store -Recurse -Force -ErrorAction Stop } catch { WriteLog "CommonCleanup: Failed removing $store : $($_.Exception.Message)" }
}
$wingetWin32AppsJson = Join-Path (Join-Path $AppsPath 'Orchestration') 'WinGetWin32Apps.json'
if (Test-Path -LiteralPath $wingetWin32AppsJson) {
WriteLog "CommonCleanup: Removing $wingetWin32AppsJson"
try { Remove-Item -LiteralPath $wingetWin32AppsJson -Force -ErrorAction Stop } catch { WriteLog "CommonCleanup: Failed removing $wingetWin32AppsJson : $($_.Exception.Message)" }
}
$office = Join-Path $AppsPath 'Office'
if ((Test-Path -LiteralPath $office) -and $InstallOffice) {
WriteLog "CommonCleanup: Checking for Office artifacts in $office"