]> vilimpoc.org git repositories - dotfiles/commitdiff
dotfiles: register UI.Xaml 2.8 for the account before installing Terminal master
authorMax Vilimpoc <max@vilimpoc.org>
Wed, 30 Sep 2026 11:43:02 +0000 (13:43 +0200)
committerMax Vilimpoc <max@vilimpoc.org>
Wed, 30 Sep 2026 11:43:02 +0000 (13:43 +0200)
`winget install Microsoft.WindowsTerminal` failed on the Windows 10 box,
on every run, with

    Installer failed with exit code: 0x80070002 : The system cannot find
    the file specified.

and it was never Terminal that failed. Its manifest depends on the
Microsoft.UI.Xaml.2.8 framework package, which winget 1.29.380 installs
first, from a pinned 8.2310.30001.0 appx. A newer build, 8.2501.31001.0,
was already staged on the machine but not registered for the account
running the setup. Windows then stages nothing - "A higher version
8.2501.31001.0 of this package is already installed", AppXDeploymentServer
event 735 - and reports the stage as a success; winget registers the
8.2310 package it believes it staged, by full name; there is no such
package (0x80073CF1); and that is what comes out as "file not found".

The WindowsTerminal step now registers the build that is already there
first: Add-AppxPackage -RegisterByFamilyName, which takes no version and
no elevation, and only when the account has none registered. winget then
finds the dependency met and installs Terminal alone. With none on the
machine either - the fresh box - the registration fails with that same
0x80073CF1, says nothing, and winget installs the framework as before.
Any other failure is a one-line warning, and winget still gets its turn.

It runs through Windows PowerShell: the Appx module does not load in
PowerShell 7 here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README.md
setup-windows.bat

index cf8a85b04a838b0aa3b25e82320667cdd9218d6f..67e6a3b38c50f1f35a74545f72f8a59384cccb7f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -354,6 +354,17 @@ missing or out of date.
   `PATH`; the step warns if it finds one (`winget uninstall
   Anthropic.ClaudeCode` removes it), and the architecture audit shows which
   `claude.exe` wins.
   `PATH`; the step warns if it finds one (`winget uninstall
   Anthropic.ClaudeCode` removes it), and the architecture audit shows which
   `claude.exe` wins.
+- **Windows Terminal gets its framework package registered first.** Terminal is
+  an MSIX that depends on `Microsoft.UI.Xaml.2.8`, which winget installs for it
+  from a pinned build (8.2310.30001.0). When a *newer* build is already on the
+  machine but not registered for the account running the setup, Windows
+  declines to stage the older one, winget then tries to register a package
+  that is not there, and what it prints is `Installer failed with exit code:
+  0x80070002 : The system cannot find the file specified` — with Terminal
+  itself never attempted, on every run. So the batch file first registers the
+  build that is already there (`Add-AppxPackage -RegisterByFamilyName`, no
+  elevation needed), and winget then finds the dependency met. With none on
+  the machine it does nothing, and winget installs the framework as usual.
 - **Rust.** winget installs rustup (`Rustlang.Rustup`, per-user, under
   `%USERPROFILE%\.cargo` and `.rustup`). Its silent install is
   `rustup-init -y -q`, which already sets up a stable toolchain for whatever
 - **Rust.** winget installs rustup (`Rustlang.Rustup`, per-user, under
   `%USERPROFILE%\.cargo` and `.rustup`). Its silent install is
   `rustup-init -y -q`, which already sets up a stable toolchain for whatever
index a6bc8ea30e7b9562b00af1a30e7ca9c93e1a1258..d49edd4b5c52585d9d78e83fb4296b88f1e9171d 100644 (file)
@@ -213,7 +213,44 @@ call :winget ProcessExplorer Microsoft.Sysinternals.ProcessExplorer
 call :winget ProcessMonitor Microsoft.Sysinternals.ProcessMonitor\r
 call :winget SDelete Microsoft.Sysinternals.SDelete\r
 call :winget VSCode Microsoft.VisualStudioCode\r
 call :winget ProcessMonitor Microsoft.Sysinternals.ProcessMonitor\r
 call :winget SDelete Microsoft.Sysinternals.SDelete\r
 call :winget VSCode Microsoft.VisualStudioCode\r
+\r
+@rem --- Windows Terminal, after registering the framework package it needs ---\r
+@rem\r
+@rem Terminal is an MSIX, and its manifest depends on the Microsoft.UI.Xaml.2.8\r
+@rem framework package (>= 8.2306.22001.0), which winget installs first, from the\r
+@rem 8.2310.30001.0 appx. That goes wrong when a NEWER build of the framework is\r
+@rem already on the machine but not registered for this account - measured on\r
+@rem the Windows 10 box, winget 1.29.380, with 8.2501.31001.0 staged and none\r
+@rem registered for the account running this:\r
+@rem   - Windows stages nothing ("A higher version 8.2501.31001.0 of this package\r
+@rem     is already installed", AppXDeploymentServer event 735) and reports the\r
+@rem     stage as a success;\r
+@rem   - winget then registers the 8.2310 package it believes it staged, by full\r
+@rem     name, and there is no such package (0x80073CF1);\r
+@rem   - which it prints as\r
+@rem         Installer failed with exit code: 0x80070002 : The system cannot\r
+@rem         find the file specified.\r
+@rem     and Terminal itself is never attempted. On every run, since a failed\r
+@rem     run changes nothing.\r
+@rem\r
+@rem So register the build that is already there for this account first - by\r
+@rem family name, which takes no version and no elevation. winget then finds the\r
+@rem dependency met and installs Terminal alone. Asked only when this account\r
+@rem has none registered, the case measured, so a re-run - Terminal and its\r
+@rem framework both in place - changes nothing.\r
+@rem\r
+@rem With none on the machine either, the registration fails with that same\r
+@rem 0x80073CF1, and that is not worth a line: it is the fresh box, where nothing\r
+@rem is in winget's way and it installs the framework itself. Any other failure\r
+@rem is reported, and winget still gets its turn.\r
+@rem\r
+@rem %PS64% because it is Windows PowerShell: the Appx module does not load in\r
+@rem PowerShell 7 here ("Operation is not supported on this platform").\r
+call :want WindowsTerminal || goto :after_terminal\r
+"%PS64%" -NoProfile -ExecutionPolicy Bypass -Command "$f = 'Microsoft.UI.Xaml.2.8'; if (-not (Get-AppxPackage $f)) { try { Add-AppxPackage -RegisterByFamilyName -MainPackage ($f + '_8wekyb3d8bbwe') -ErrorAction Stop; Write-Host ('[setup-windows] WindowsTerminal: registered ' + $f + ' ' + @(Get-AppxPackage $f)[0].Version + ', already on this machine, for this account.') } catch { if ($_.Exception.Message -notmatch '0x80073CF1') { Write-Host ('[setup-windows] WARNING: could not register ' + $f + ' for this account: ' + ($_.Exception.Message -split '\r?\n')[0]) } } }"\r
 call :winget WindowsTerminal Microsoft.WindowsTerminal\r
 call :winget WindowsTerminal Microsoft.WindowsTerminal\r
+:after_terminal\r
+\r
 call :winget Python Python.Python.3.13\r
 \r
 @rem WinMerge is the one package here where winget's own preference order picks\r
 call :winget Python Python.Python.3.13\r
 \r
 @rem WinMerge is the one package here where winget's own preference order picks\r