From 9194db96c6f8778f2b0b87e486d233a9b7f05f16 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Mon, 18 May 2026 11:51:10 -0400 Subject: [PATCH] Add proxy support for "Check for Updates" (#314) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corporate-proxy users were hitting "Check for Updates" failures because neither Velopack's downloader nor the HttpClient fallback was sending Windows credentials to the proxy. James (issue #314) confirmed his proxy is auto-discovered for most apps but SSMS 25 needed manual address + on-prem AD user/pass, so both paths are needed. * ProxySettings — "System" (default) sends Windows credentials to the auto-discovered proxy; "Manual" lets the user enter address + optional username/password. Password is held in the existing ICredentialService (Windows Credential Manager / macOS Keychain). * ProxyHttpHandlerFactory — single source of truth for proxy wiring on HttpClientHandler. Used by both UpdateChecker (GitHub API fallback) and ProxyAwareDownloader (Velopack's IFileDownloader override). * ProxyAwareDownloader subclasses Velopack.Sources.HttpClientFileDownloader and snapshots ProxySettings at construction so retries/redirects don't re-read DPAPI. * SettingsFile — merge-safe JSON read/update so the MCP and Proxy save paths don't stomp each other. * AboutWindow — proxy settings UI (radio + collapsed manual grid). The password field is intentionally not round-tripped through the UI; watermark says "(saved — leave blank to keep)". Status text now wraps. When the update check fails, a "Open the releases page in your browser" link is shown as a manual-download fallback. * If Velopack itself fails (the actual #314 symptom), its error is now surfaced alongside the API fallback error instead of being swallowed. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/PlanViewer.App/AboutWindow.axaml | 50 +++++++++- src/PlanViewer.App/AboutWindow.axaml.cs | 99 +++++++++++++++---- .../Services/ProxyAwareDownloader.cs | 22 +++++ .../Services/ProxyHttpHandlerFactory.cs | 53 ++++++++++ src/PlanViewer.App/Services/ProxySettings.cs | 81 +++++++++++++++ src/PlanViewer.App/Services/SettingsFile.cs | 38 +++++++ src/PlanViewer.App/Services/UpdateChecker.cs | 20 ++-- 7 files changed, 330 insertions(+), 33 deletions(-) create mode 100644 src/PlanViewer.App/Services/ProxyAwareDownloader.cs create mode 100644 src/PlanViewer.App/Services/ProxyHttpHandlerFactory.cs create mode 100644 src/PlanViewer.App/Services/ProxySettings.cs create mode 100644 src/PlanViewer.App/Services/SettingsFile.cs diff --git a/src/PlanViewer.App/AboutWindow.axaml b/src/PlanViewer.App/AboutWindow.axaml index 17f422d..1aa0790 100644 --- a/src/PlanViewer.App/AboutWindow.axaml +++ b/src/PlanViewer.App/AboutWindow.axaml @@ -2,7 +2,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="PlanViewer.App.AboutWindow" Title="About Performance Studio" - Width="450" Height="500" + Width="480" Height="640" CanResize="False" WindowStartupLocation="CenterOwner" Icon="avares://PlanViewer.App/EDD.ico" @@ -47,14 +47,22 @@