From d95d5bca1fb592c076ea6cbd88eabd9b2fd357eb Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 7 Oct 2026 01:26:37 -0700 Subject: [PATCH] fix(desktop-update): updater window opens in the Windows 11 25H2 default browser Get-DefaultBrowserExe read only the legacy UserChoice ProgId, which Windows 11 25H2 Settings no longer updates, so the update hand-off fell back to the WinForms card (or a stale browser) on machines whose real default is Chrome/Edge. Read UserChoiceLatest\ProgId first, legacy UserChoice second. Fixes #108051. Follows #108062 / #108064. Co-authored-by: KoNit-K Co-authored-by: Konstantin Khlopkov --- scripts/desktop-update/windows.ps1 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/desktop-update/windows.ps1 b/scripts/desktop-update/windows.ps1 index 07fa11711e..16b3024957 100644 --- a/scripts/desktop-update/windows.ps1 +++ b/scripts/desktop-update/windows.ps1 @@ -226,16 +226,21 @@ function Get-UiHtmlPath { } function Get-DefaultBrowserExe { - # The OS default browser, read from the UserChoice ProgId that the - # Windows Settings app writes (https first, http as fallback). Only + # The OS default browser, read from the ProgId that the Windows Settings + # app writes (https first, http as fallback). Windows 11 25H2 writes only + # UserChoiceLatest\ProgId and leaves the legacy UserChoice key stale or + # without a value, so the newer key is read first. Only # Chromium-family browsers (ChromeHTML / MSEdgeHTM) support the # --app + --user-data-dir combo the shim relies on; any other # default browser returns $null and degrades to the WinForms card. $progId = $null foreach ($proto in @("https", "http")) { - try { - $progId = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\$proto\UserChoice" -Name ProgId -ErrorAction Stop).ProgId - } catch { continue } + foreach ($sub in @("UserChoiceLatest\ProgId", "UserChoice")) { + try { + $progId = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\$proto\$sub" -Name ProgId -ErrorAction Stop).ProgId + } catch { continue } + if ($progId) { break } + } if ($progId) { break } } if (-not $progId) { return $null }