`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
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
+: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