Skip to content

Patch#26

Merged
OpenSource-For-Freedom merged 4 commits into
mainfrom
patch
May 30, 2026
Merged

Patch#26
OpenSource-For-Freedom merged 4 commits into
mainfrom
patch

Conversation

@OpenSource-For-Freedom
Copy link
Copy Markdown
Owner

No description provided.

Lets you verify by sight that a remote update was actually applied
on the target machine — the title bar shifts from one version string
to another after the user clicks "Restart to apply" (or downloads
the new portable zip).

Binds to a OneTime AppVersion property on MainViewModel that reads
Assembly.GetExecutingAssembly().GetName().Version, so the displayed
version is whatever -p:AssemblyVersion stamped at publish time.
AsyncRelayCommand.Execute is async void. Any exception thrown by the
awaited task escapes to App.DispatcherUnhandledException, which calls
Shutdown(-1) + Environment.Exit(-1) unconditionally — one broken
command takes the whole process down.

Concrete repro: clicking Trace Caller on a machine where 'powershell'
isn't on PATH (Win11 SE, certain MDM-locked configs) makes
Process.Start throw Win32Exception, which propagates up async void
and exits the app with no diagnostic visible to the user. Reported
as 'shut down randomly after we clicked Trace Caller'.

Three-layer fix:
- AsyncRelayCommand and AsyncRelayCommand<T> catch all exceptions in
  Execute and Debug.WriteLine them; the command stays disabled-then-
  reenabled normally instead of killing the process.
- TraceOriginAsync wraps its body in a try/catch that logs the
  failure to AppendLog so the user sees WHY the trace produced no
  output instead of staring at an empty section.
- RunCommandCaptureAsync catches Process.Start failure and returns
  the error as captured output instead of throwing — the existing
  'Could not parse trace output' path then shows it gracefully.
Both Python install paths (winget and python.org fallback) treated
"install succeeded but FindPythonAsync didn't immediately locate the
binary" the same as "install failed" — they continued the outer loop
and installed the NEXT Python version on top of the one that just
landed. Each retry fires its own UAC prompt and installer screen, so
the user sees the setup "loop around 'install to path'" repeatedly
even though Python was already installed after the first attempt.

The detection-miss is real: winget can put Python at a path that
isn't on the process's inherited PATH yet, and the registry-refresh
trick doesn't always pick it up before the next FindPythonAsync runs.
But it's a *detection* problem, not an install problem.

Both paths now bail after the first successful install code with a
clear "restart WRAITH to pick it up" message. The winget path also
skips the official-installer fallback when winget itself succeeded
(no point downloading python.org's installer to put down a *third*
Python).
Copilot AI review requested due to automatic review settings May 30, 2026 01:20
Comment thread WRAITH/Services/BootstrapService.cs Dismissed
Comment thread WRAITH/Services/BootstrapService.cs Dismissed
…ed in path expression'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves resilience during command execution and Python bootstrapping, and adds a visible application version to the custom WPF title bar.

Changes:

  • Adds fallback exception handling for async commands and trace-origin execution paths.
  • Prevents repeated Python installer attempts after a successful install cannot be detected immediately.
  • Displays AppVersion from the executing assembly in the title bar.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
WRAITH/ViewModels/MainViewModel.cs Adds async command exception guards, trace failure logging, command-start failure handling, and AppVersion.
WRAITH/Services/BootstrapService.cs Stops winget/official installer retry loops after successful-but-undetected Python installs.
WRAITH/MainWindow.xaml Updates the title bar text to include the bound application version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@OpenSource-For-Freedom OpenSource-For-Freedom merged commit d04d0df into main May 30, 2026
7 checks passed
@OpenSource-For-Freedom OpenSource-For-Freedom deleted the patch branch May 30, 2026 01:26
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.

3 participants