Skip to content

2.0 phase 1, PR 1: app skeleton and Core winget CLI reads - #33

Merged
FedeB2160 merged 1 commit into
mainfrom
claude/v2-skeleton-fdb808
Oct 29, 2026
Merged

FedeB2160 merged 1 commit into
mainfrom
claude/v2-skeleton-fdb808

Conversation

@FedeB2160

Copy link
Copy Markdown
Owner

First of five pull requests for phase 1 of 2.0 (C# on .NET 10 WPF, ADR 0023-0027). Nothing in src/, ui/ or tests/*.ps1 changes.

What is in it

  • app/WinGetStudio.sln: WinGetStudio (an empty WPF window, ThemeMode="System", asInvoker, PerMonitorV2), WinGetStudio.Core, WinGetStudio.Core.Tests (xUnit v3).
  • global.json: .NET 10 SDK, 10.0.100 or a later 10.0 feature band, no previews (ADR 0026). It also opts dotnet test into Microsoft.Testing.Platform, which xUnit v3 needs on SDK 10.
  • Core
    • ExitCodes: the table fixed in v1.13 (PR fix: exit codes, cmd expansion, signed self-update, import arguments #31).
    • ProcessRunner: CreateProcess without cmd. stdout and stderr go to files, PROC_THREAD_ATTRIBUTE_HANDLE_LIST limits inheritance to them and NUL, and the wait is on the process alone (ADR 0004, ADR 0025). Output is read as UTF-8, and leftover wgt_* files are cleaned by TempFiles.
    • CommandLine: quoting for CommandLineToArgvW; no shell sees the arguments.
    • WinGetTable: the column-position parser (ADR 0006), plus the output tail and the details text.
    • WinGetCli : IWinGetBackend: search (winget, then msstore), installed, upgrades, pins and details, with the same behaviour as 1.x. It also adds:
      • one static lock, so only one winget runs at a time (ADR 0003);
      • read results instead of lists (ADR 0005);
      • id validation (no leading -, no control characters);
      • --no-progress from winget 1.29.
  • CI: a dotnet job (setup-dotnet 10.0.x, build Release, dotnet test).
  • Docs: a "Version 2" section in DEVELOPMENT.md and the test command in CLAUDE.md.

Tests

75 tests, ported from the fixtures of tests/Test-InvokeWinGet.ps1:

  • the readers run against a fake runner;
  • the runner tests start real cmd.exe and ping (a detached child, UTF-8, a negative exit code, the tick);
  • the quoting tests round-trip through CommandLineToArgvW.

Run locally:

  • Debug and Release: green;
  • Test-InvokeWinGet.ps1 and Test-Ui.ps1: green;
  • a smoke script against the real winget 1.29.380 read 4 upgrades, 361 installed packages, search results and details.

Notes

  • The winget version comes from winget --version (under the lock), not from the App Installer package as in 1.x: reading the package needs the WinRT projection, which would add tens of MB to the ~200 KB framework-dependent exe. To be measured before the winget setup (PR 4) and COM (phase 4).
  • Known limit, marked in the code: the output handles are inheritable for an instant, so another process this app started at that moment would inherit them. Today the app starts nothing else alongside winget.

Next pull requests

  1. Core: queue, pins, HKCU preferences, export/import.
  2. Fluent window with the three tabs, log, details, themed dialogs.
  3. Settings, About, self-update, winget setup.
  4. Elevation model of ADR 0024.

🤖 Generated with Claude Code

First step of phase 1 (ADR 0023-0027). app\ holds the solution: an empty
WPF window on the Fluent theme, asInvoker, and WinGetStudio.Core with the
exit-code table, a process runner without cmd (CreateProcess with output
files and a handle list, wait on the process only), argument quoting for
CommandLineToArgvW, the column-position parser and the CLI readers
(search, list, upgrade, pin list, details) under one global lock.

The 75 tests port the fixtures of tests\Test-InvokeWinGet.ps1.
global.json pins the .NET 10 SDK and opts dotnet test into
Microsoft.Testing.Platform; CI gets a dotnet job.

Co-Authored-By: Claude <noreply@anthropic.com>
@FedeB2160
FedeB2160 merged commit 54e999b into main Oct 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant