From 92c9c3102acba844e9c9d62b584ef5dcd59fd58d Mon Sep 17 00:00:00 2001
From: roboclaw-bot <309084314+roboclaw-bot@users.noreply.github.com>
Date: Sat, 31 Oct 2026 23:30:24 +0000
Subject: [PATCH 1/6] fix: Installed apps shows an old version after in-app
updates
Worked on by:
- @MertBasar0
Co-authored-by: MertBasar0 <100199793+MertBasar0@users.noreply.github.com>
OpenClaw-Publication: 47010fa4-3a86-447c-86ce-a6abffe97f49
---
docs/ARCHITECTURE.md | 1 +
src/OpenClaw.Tray.WinUI/App.xaml.cs | 6 +
.../Helpers/InnoInstallationMetadata.cs | 81 +++++++++
.../InnoInstallationMetadataTests.cs | 162 ++++++++++++++++++
.../OpenClaw.Tray.Tests.csproj | 1 +
5 files changed, 251 insertions(+)
create mode 100644 src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs
create mode 100644 tests/OpenClaw.Tray.Tests/InnoInstallationMetadataTests.cs
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index ffcd05e3d6..3f911ac417 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -132,6 +132,7 @@ new attempt. This boundary does not change release signing or Windows policy.
| Raw MXC EXE/Win32-pipe transport, generic JSON policy DTOs and failure-triggered host fallback | Retired. SDK/load/request failures never select host execution | closed |
| Positively unsupported Windows command compatibility | `MxcAvailability` supplies the positive OS verdict; `MxcCommandRunner` admits `UnsupportedWindowsCommandExecutor` with approved argv, revalidation, deadline and bounded process ownership | authoritative |
| Obsolete npm MXC payload cleanup on unpackaged startup | `LegacyMxcFiles` deletes only four historically shipped files, refuses reparse traversal and preserves unknown files and OS-managed package versions; `App` only delegates after primary-instance admission | authoritative |
+| Existing Inno Installed apps display metadata after ZIP updates | `InnoInstallationMetadata` refreshes only `DisplayVersion`/`DisplayName` for the running same-user production installation; Inno retains registration creation, installation date and uninstall ownership. `App` delegates synchronously after admitted startup and before its completion marker | authoritative |
| Cooperating JSON persistence coordination | `PersistenceFileLease`; registry expected-snapshot Save and settings loaded-JSON CAS hold it through atomic replacement | authoritative |
| Settings persistence conflict state and visible recovery | `SettingsManager` owns typed CAS rejection; `SettingsPersistenceNotification` owns dispatched, deduplicated restart guidance; App composes/disposes it | authoritative |
| V2 exec-approvals snapshot/CAS persistence + observation | `ExecApprovalsStore` through `IExecApprovalsPresentationStore` | authoritative |
diff --git a/src/OpenClaw.Tray.WinUI/App.xaml.cs b/src/OpenClaw.Tray.WinUI/App.xaml.cs
index 1765e3f6e6..85ac08dc24 100644
--- a/src/OpenClaw.Tray.WinUI/App.xaml.cs
+++ b/src/OpenClaw.Tray.WinUI/App.xaml.cs
@@ -1072,6 +1072,12 @@ _dispatcherQueue is null
activation.Kind));
await _activationRouter.DispatchPlanAsync(launchPlan, this, CancellationToken.None);
+ var registrationWarning = new InnoInstallationMetadata().Refresh(
+ Environment.ProcessPath, AppVersionInfo.Version,
+ PackageHelper.IsPackaged, AppIdentity.IsDev, AppIdentity.IsIsolated);
+ if (registrationWarning is not null)
+ Logger.Warn(registrationWarning);
+
Logger.Info("Application started (WinUI 3)");
}
diff --git a/src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs b/src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs
new file mode 100644
index 0000000000..71e8660715
--- /dev/null
+++ b/src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs
@@ -0,0 +1,81 @@
+using System.Runtime.Versioning;
+using System.Security;
+using Microsoft.Win32;
+
+namespace OpenClawTray.Helpers;
+
+///
+/// Refreshes the display metadata that Inno cannot update when Updatum replaces files.
+/// The installer still owns registration creation and all uninstall behavior.
+///
+[SupportedOSPlatform("windows")]
+internal sealed class InnoInstallationMetadata
+{
+ internal const string UninstallKey =
+ @"Software\Microsoft\Windows\CurrentVersion\Uninstall\{M0LTB0T-TRAY-4PP1-D3N7}_is1";
+
+ private const string DisplayNamePrefix = "OpenClaw Companion version ";
+ private readonly Func _openRegistration;
+
+ // The registry opener is the OS boundary; tests use a task-owned HKCU subtree.
+ internal InnoInstallationMetadata(Func? openRegistration = null)
+ {
+ _openRegistration = openRegistration ??
+ (() => Registry.CurrentUser.OpenSubKey(UninstallKey, writable: true));
+ }
+
+ public string? Refresh(string? executablePath, string version,
+ bool isPackaged, bool isDev, bool isIsolated)
+ {
+ if (isPackaged || isDev || isIsolated || string.IsNullOrWhiteSpace(executablePath) ||
+ string.IsNullOrWhiteSpace(version) || version == "0.0.0")
+ return null;
+
+ try
+ {
+ if (!Path.IsPathFullyQualified(executablePath) ||
+ !string.Equals(Path.GetFileName(executablePath), "OpenClaw.Tray.WinUI.exe",
+ StringComparison.OrdinalIgnoreCase))
+ return null;
+
+ var directory = Path.GetDirectoryName(executablePath)!;
+ using var key = _openRegistration();
+ if (key is null)
+ return null; // Portable runs never create an installation record.
+
+ var location = ReadString(key, "InstallLocation");
+ var displayName = ReadString(key, "DisplayName");
+ var displayVersion = ReadString(key, "DisplayVersion");
+ if (ReadString(key, "Publisher") != "OpenClaw Foundation" ||
+ location is null ||
+ !string.Equals(location.TrimEnd('\\'), directory.TrimEnd('\\'), StringComparison.OrdinalIgnoreCase) ||
+ !string.Equals(ReadString(key, "UninstallString"),
+ $"\"{Path.Combine(directory, "unins000.exe")}\"", StringComparison.OrdinalIgnoreCase) ||
+ displayName is null || !displayName.StartsWith(DisplayNamePrefix, StringComparison.Ordinal) ||
+ displayVersion is null)
+ return null;
+
+ // Do not use migration admission here: it intentionally rejects the stale
+ // version this startup repair owns. Never rewrite identity or uninstall fields.
+ // Separate value writes may be interrupted; the next startup repairs either field.
+ if (displayVersion != version)
+ key.SetValue("DisplayVersion", version, RegistryValueKind.String);
+ var expectedName = DisplayNamePrefix + version;
+ if (displayName != expectedName)
+ key.SetValue("DisplayName", expectedName, RegistryValueKind.String);
+ }
+ catch (Exception error) when (error is IOException or UnauthorizedAccessException or
+ SecurityException or ArgumentException or NotSupportedException)
+ {
+ return $"Installed apps version could not be refreshed ({error.GetType().Name}). " +
+ "Start Companion again or repair the installation with Setup.";
+ }
+ return null;
+ }
+
+ private static string? ReadString(RegistryKey key, string name)
+ {
+ var value = key.GetValue(name, null, RegistryValueOptions.DoNotExpandEnvironmentNames);
+ return value is string text && key.GetValueKind(name) == RegistryValueKind.String ? text : null;
+ }
+}
diff --git a/tests/OpenClaw.Tray.Tests/InnoInstallationMetadataTests.cs b/tests/OpenClaw.Tray.Tests/InnoInstallationMetadataTests.cs
new file mode 100644
index 0000000000..04d8439672
--- /dev/null
+++ b/tests/OpenClaw.Tray.Tests/InnoInstallationMetadataTests.cs
@@ -0,0 +1,162 @@
+using System.Runtime.Versioning;
+using System.Security;
+using System.Text.Json;
+using Microsoft.Win32;
+using OpenClaw.Connection.Migration;
+using OpenClawTray.Helpers;
+
+namespace OpenClaw.Tray.Tests;
+
+[SupportedOSPlatform("windows")]
+public sealed class InnoInstallationMetadataTests
+{
+ private const string Executable = @"C:\OpenClaw Test Fixture\Companion\OpenClaw.Tray.WinUI.exe";
+
+ [WindowsFact]
+ public void RunningReleaseRefreshesOnlyDisplayFieldsAndRemainsIdempotent()
+ {
+ foreach (var version in new[] { "2026.9.8-2", "2026.9.5-alpha.117", "2026.9.8-10" })
+ {
+ using var fixture = new RegistrationFixture();
+ var before = fixture.Snapshot();
+
+ Assert.Null(fixture.Owner.Refresh(Executable, version, false, false, false));
+
+ using var registration = fixture.Open();
+ Assert.Equal(version, registration.GetValue("DisplayVersion"));
+ Assert.Equal("OpenClaw Companion version " + version, registration.GetValue("DisplayName"));
+ Assert.Equal(RegistryValueKind.String, registration.GetValueKind("DisplayVersion"));
+ Assert.Equal(RegistryValueKind.String, registration.GetValueKind("DisplayName"));
+ var after = fixture.Snapshot();
+ Assert.Equal(before.Keys.Order(), after.Keys.Order());
+ foreach (var name in before.Keys.Except(["DisplayVersion", "DisplayName"]))
+ Assert.Equal(before[name], after[name]);
+
+ Assert.Null(fixture.Owner.Refresh(Executable, version, false, false, false));
+ Assert.Equal(after.OrderBy(pair => pair.Key), fixture.Snapshot().OrderBy(pair => pair.Key));
+ }
+ }
+
+ [WindowsFact]
+ public void InterruptedDisplayRefreshIsRepairedOnNextStartup()
+ {
+ foreach (var changedField in new[] { "DisplayVersion", "DisplayName" })
+ {
+ using var fixture = new RegistrationFixture();
+ using (var registration = fixture.Open())
+ registration.SetValue(changedField, changedField == "DisplayVersion"
+ ? "2026.9.8-2" : "OpenClaw Companion version 2026.9.8-2");
+
+ Assert.Null(fixture.Owner.Refresh(Executable, "2026.9.8-2", false, false, false));
+ using var after = fixture.Open();
+ Assert.Equal("2026.9.8-2", after.GetValue("DisplayVersion"));
+ Assert.Equal("OpenClaw Companion version 2026.9.8-2", after.GetValue("DisplayName"));
+ }
+ }
+
+ [WindowsFact]
+ public void ForeignOrMalformedRegistrationRemainsUnchanged()
+ {
+ foreach (var field in new[] { "InstallLocation", "Publisher", "UninstallString", "DisplayName", "DisplayVersion" })
+ {
+ using var fixture = new RegistrationFixture();
+ using (var registration = fixture.Open())
+ {
+ if (field == "DisplayVersion")
+ registration.SetValue(field, 42, RegistryValueKind.DWord);
+ else
+ registration.SetValue(field, "different installation", RegistryValueKind.String);
+ }
+ var before = fixture.Snapshot();
+ Assert.Null(fixture.Owner.Refresh(Executable, "2026.9.8-2", false, false, false));
+ Assert.Equal(before.OrderBy(pair => pair.Key), fixture.Snapshot().OrderBy(pair => pair.Key));
+ }
+ }
+
+ [WindowsFact]
+ public void PortableCopyCannotRefreshAnotherInstalledCopy()
+ {
+ using var fixture = new RegistrationFixture();
+ var before = fixture.Snapshot();
+ Assert.Null(fixture.Owner.Refresh(@"C:\Portable\OpenClaw.Tray.WinUI.exe", "2026.9.8-2", false, false, false));
+ Assert.Equal(before.OrderBy(pair => pair.Key), fixture.Snapshot().OrderBy(pair => pair.Key));
+ }
+
+ [Fact]
+ public void PackagedDevAndIsolatedProcessesNeverOpenRegistration()
+ {
+ var owner = new InnoInstallationMetadata(() => throw new InvalidOperationException("Registry must not be opened"));
+ Assert.Null(owner.Refresh(Executable, "2026.9.8-2", true, false, false));
+ Assert.Null(owner.Refresh(Executable, "2026.9.8-2", false, true, false));
+ Assert.Null(owner.Refresh(Executable, "2026.9.8-2", false, false, true));
+ }
+
+ [WindowsFact]
+ public void MissingRegistrationIsNotCreated()
+ {
+ var owner = new InnoInstallationMetadata(() => null);
+ Assert.Null(owner.Refresh(Executable, "2026.9.8-2", false, false, false));
+ }
+
+ [WindowsFact]
+ public void RegistryFailureReturnsRecoveryWarningWithoutBlockingStartup()
+ {
+ foreach (var failure in new Exception[]
+ {
+ new UnauthorizedAccessException(), new SecurityException(), new IOException()
+ })
+ {
+ var owner = new InnoInstallationMetadata(() => throw failure);
+ var warning = owner.Refresh(Executable, "2026.9.8-2", false, false, false);
+ Assert.NotNull(warning);
+ Assert.Contains(failure.GetType().Name, warning);
+ Assert.Contains("repair the installation with Setup", warning);
+ }
+ }
+
+ [Fact]
+ public void StartupRefreshFollowsAdmissionAndCompletesBeforeStartupMarker()
+ {
+ var source = File.ReadAllText(Path.Combine(TestRepositoryPaths.GetRepositoryRoot(),
+ "src", "OpenClaw.Tray.WinUI", "App.xaml.cs"));
+ var launch = source[source.IndexOf("private async Task OnLaunchedAsync", StringComparison.Ordinal)..];
+ var refresh = launch.IndexOf("new InnoInstallationMetadata().Refresh(", StringComparison.Ordinal);
+ Assert.True(refresh > launch.IndexOf("InnoMigrationStartupGuard.ShouldStopLaunch", StringComparison.Ordinal));
+ Assert.True(refresh > launch.IndexOf("ForwardLaunchToPrimaryAsync", StringComparison.Ordinal));
+ Assert.True(refresh > launch.IndexOf("await _activationRouter.DispatchPlanAsync", StringComparison.Ordinal));
+ Assert.True(refresh < launch.IndexOf("Logger.Info(\"Application started (WinUI 3)\")", StringComparison.Ordinal));
+ Assert.Equal(InnoInstallationDetector.UninstallKey, InnoInstallationMetadata.UninstallKey);
+ }
+
+ private sealed class RegistrationFixture : IDisposable
+ {
+ private readonly string _path = @"Software\OpenClaw.Tests\Issue1676-" + Guid.NewGuid().ToString("N");
+ public InnoInstallationMetadata Owner => new(() => Open());
+
+ public RegistrationFixture()
+ {
+ using var key = Registry.CurrentUser.CreateSubKey(_path);
+ key.SetValue("InstallLocation", @"C:\OpenClaw Test Fixture\Companion\");
+ key.SetValue("Publisher", "OpenClaw Foundation");
+ key.SetValue("UninstallString", @"""C:\OpenClaw Test Fixture\Companion\unins000.exe""");
+ key.SetValue("DisplayName", "OpenClaw Companion version 2026.9.5-alpha.93");
+ key.SetValue("DisplayVersion", "2026.9.5-alpha.93");
+ key.SetValue("InstallDate", "20261003");
+ key.SetValue("MajorVersion", 2026, RegistryValueKind.DWord);
+ key.SetValue("QuietUninstallString", @"""C:\OpenClaw Test Fixture\Companion\unins000.exe"" /SILENT");
+ key.SetValue("UnknownValue", new byte[] { 3, 1, 4 }, RegistryValueKind.Binary);
+ }
+
+ public RegistryKey Open() => Registry.CurrentUser.OpenSubKey(_path, writable: true)!;
+
+ public Dictionary Snapshot()
+ {
+ using var key = Open();
+ return key.GetValueNames().ToDictionary(name => name, name =>
+ (key.GetValueKind(name), JsonSerializer.Serialize(key.GetValue(name, null,
+ RegistryValueOptions.DoNotExpandEnvironmentNames))));
+ }
+
+ public void Dispose() => Registry.CurrentUser.DeleteSubKeyTree(_path);
+ }
+}
diff --git a/tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj b/tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj
index ba4ea55adb..78cbe5feec 100644
--- a/tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj
+++ b/tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj
@@ -214,6 +214,7 @@
+
From 660c7cbd4c9d647aafa68834a3e1dfc16486f744 Mon Sep 17 00:00:00 2001
From: roboclaw-bot <309084314+roboclaw-bot@users.noreply.github.com>
Date: Wed, 4 Nov 2026 03:42:51 +0000
Subject: [PATCH 2/6] test: require startup admission before Inno metadata
refresh
Worked on by:
- @MertBasar0
Co-authored-by: MertBasar0 <100199793+MertBasar0@users.noreply.github.com>
OpenClaw-Publication: 76ff21e2-713d-4aed-aa3e-ba97d1dcebd7
---
tests/OpenClaw.Tray.Tests/InnoInstallationMetadataTests.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/OpenClaw.Tray.Tests/InnoInstallationMetadataTests.cs b/tests/OpenClaw.Tray.Tests/InnoInstallationMetadataTests.cs
index 04d8439672..239b70e000 100644
--- a/tests/OpenClaw.Tray.Tests/InnoInstallationMetadataTests.cs
+++ b/tests/OpenClaw.Tray.Tests/InnoInstallationMetadataTests.cs
@@ -121,9 +121,9 @@ public void StartupRefreshFollowsAdmissionAndCompletesBeforeStartupMarker()
"src", "OpenClaw.Tray.WinUI", "App.xaml.cs"));
var launch = source[source.IndexOf("private async Task OnLaunchedAsync", StringComparison.Ordinal)..];
var refresh = launch.IndexOf("new InnoInstallationMetadata().Refresh(", StringComparison.Ordinal);
- Assert.True(refresh > launch.IndexOf("InnoMigrationStartupGuard.ShouldStopLaunch", StringComparison.Ordinal));
- Assert.True(refresh > launch.IndexOf("ForwardLaunchToPrimaryAsync", StringComparison.Ordinal));
- Assert.True(refresh > launch.IndexOf("await _activationRouter.DispatchPlanAsync", StringComparison.Ordinal));
+ Assert.InRange(launch.IndexOf("InnoMigrationStartupGuard.ShouldStopLaunch", StringComparison.Ordinal), 0, refresh - 1);
+ Assert.InRange(launch.IndexOf("ForwardLaunchToPrimaryAsync", StringComparison.Ordinal), 0, refresh - 1);
+ Assert.InRange(launch.IndexOf("await _activationRouter.DispatchPlanAsync", StringComparison.Ordinal), 0, refresh - 1);
Assert.True(refresh < launch.IndexOf("Logger.Info(\"Application started (WinUI 3)\")", StringComparison.Ordinal));
Assert.Equal(InnoInstallationDetector.UninstallKey, InnoInstallationMetadata.UninstallKey);
}
From b68e4cef2f3b8d40b6c09b1f1e02b9798de71e1b Mon Sep 17 00:00:00 2001
From: roboclaw-bot <309084314+roboclaw-bot@users.noreply.github.com>
Date: Fri, 6 Nov 2026 21:12:49 +0000
Subject: [PATCH 3/6] chore: merge main into Inno metadata repair
Worked on by:
- @MertBasar0
Co-authored-by: MertBasar0 <100199793+MertBasar0@users.noreply.github.com>
OpenClaw-Publication: de756344-b9e9-4cf2-aaab-89af7a9ff05d
From c973d947e5010bed8f7b59c23c5940b08e406577 Mon Sep 17 00:00:00 2001
From: Karen <7976322+karkarl@users.noreply.github.com>
Date: Fri, 6 Nov 2026 15:19:22 -0800
Subject: [PATCH 4/6] fix: disabled onboarding actions report the wrong
automation error (#2050)
Return the standard UIA disabled HRESULT so native clients do not substitute stale worker-thread COM error info. Retain deterministic stale-error, mounted-lifetime, and no-activation coverage.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 3435fbaeefe34efbc1f1c58c62455093f260a8ee)
---
docs/TEST_COVERAGE.md | 1 +
.../Controls/SetupActionCard.cs | 7 ++++--
.../OnboardingAiPageTests.cs | 25 +++++++++++++++++--
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/docs/TEST_COVERAGE.md b/docs/TEST_COVERAGE.md
index aff6569814..82405435fa 100644
--- a/docs/TEST_COVERAGE.md
+++ b/docs/TEST_COVERAGE.md
@@ -155,6 +155,7 @@ Unset the opt-in after the run.
- **OpenClaw.Tray.UITests** covers A2UI/native WinUI rendering behavior that is awkward to validate through pure unit tests.
Markdown renderer record-shape tests also belong to `UICollection`: their WinRT-backed types must not initialize concurrently with the shared Windows App SDK bootstrap. A smoke-test contract guards both Markdown test classes' collection membership.
- Onboarding AI card-action tests wait up to 10 seconds for the target card to be loaded, enabled, click-enabled, and attached to the page's non-null XamlRoot. Readiness timeouts report each condition; regression tests hold each readiness flag false before releasing it and verify that a permanently blocked card never invokes its action. A dispatcher yield alone is not a control-loaded guarantee.
+- Native current-model UIA coverage requires the standard disabled HRESULT (`UIA_E_ELEMENTNOTENABLED`, `0x80040200`) even when the client worker carries unrelated COM error info. It verifies that the same card remains available and mounted without activation, that non-clickable cards do not advertise Invoke, and that enabled native invocation activates the selected model.
- **OpenClaw.WinNode.Cli.Tests** covers the standalone Windows node CLI contract.
- **OpenClaw.SetupEngine.Tests** covers gateway setup and local WSL installation policy.
- **OpenClawTray.FunctionalUI.Tests** covers newer UI surfaces outside the main tray test project.
diff --git a/src/OpenClaw.SetupEngine.UI/Controls/SetupActionCard.cs b/src/OpenClaw.SetupEngine.UI/Controls/SetupActionCard.cs
index a5c4bb2e13..dc2d0c50bb 100644
--- a/src/OpenClaw.SetupEngine.UI/Controls/SetupActionCard.cs
+++ b/src/OpenClaw.SetupEngine.UI/Controls/SetupActionCard.cs
@@ -1,6 +1,6 @@
+using System.Runtime.InteropServices;
using CommunityToolkit.WinUI.Controls;
using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Automation;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Automation.Provider;
@@ -19,10 +19,13 @@ public SetupActionCard() =>
private sealed partial class ActionCardAutomationPeer(SetupActionCard owner)
: SettingsCardAutomationPeer(owner), IInvokeProvider
{
+ private const int UiaElementNotEnabled = unchecked((int)0x80040200);
+
public void Invoke()
{
if (!owner.IsEnabled || !owner.IsClickEnabled)
- throw new ElementNotEnabledException();
+ // Native UIA clients recognize UIA_E_ELEMENTNOTENABLED, not XAML's E_ELEMENTNOTENABLED.
+ throw new COMException(null, UiaElementNotEnabled);
if (!owner.DispatcherQueue.TryEnqueue(() =>
owner.InvokeRequested?.Invoke(owner, new RoutedEventArgs())))
throw new ObjectDisposedException(nameof(SetupActionCard));
diff --git a/tests/OpenClaw.Tray.UITests/OnboardingAiPageTests.cs b/tests/OpenClaw.Tray.UITests/OnboardingAiPageTests.cs
index 084f2732b7..5202fe4b63 100644
--- a/tests/OpenClaw.Tray.UITests/OnboardingAiPageTests.cs
+++ b/tests/OpenClaw.Tray.UITests/OnboardingAiPageTests.cs
@@ -152,16 +152,37 @@ await Task.Run(() =>
new System.Windows.Automation.PropertyCondition(
System.Windows.Automation.AutomationElement.AutomationIdProperty, "ChoiceActionCard"));
Assert.NotNull(target);
+ var runtimeId = target.GetRuntimeId();
if (disabled)
{
+ Assert.False(target.Current.IsEnabled);
var invoke = Assert.IsType(
target.GetCurrentPattern(System.Windows.Automation.InvokePattern.Pattern));
- var error = Assert.Throws(invoke.Invoke);
- Assert.Equal(unchecked((int)0x802B001E), error.HResult); // WinUI E_ELEMENTNOTENABLED
+ // A reused UIA worker can carry unrelated IErrorInfo. The disabled HRESULT
+ // must be recognized by UIA itself, not mapped through that stale error.
+ System.Runtime.InteropServices.Marshal.GetHRForException(
+ new System.Windows.Automation.ElementNotAvailableException());
+ try
+ {
+ var error = Assert.Throws(invoke.Invoke);
+ Assert.Equal(unchecked((int)0x80040200), error.HResult); // UIA_E_ELEMENTNOTENABLED
+ Assert.False(target.Current.IsEnabled);
+ }
+ finally
+ {
+ // Consume any injected IErrorInfo before returning this worker to the pool.
+ _ = System.Runtime.InteropServices.Marshal.GetExceptionForHR(unchecked((int)0x80004005));
+ }
}
else
Assert.False(target.TryGetCurrentPattern(System.Windows.Automation.InvokePattern.Pattern, out _));
+ Assert.Equal(runtimeId, target.GetRuntimeId());
});
+ await ui.YieldToRenderAsync();
+ Assert.Same(card, Assert.Single(TestSupport.FindDescendants(choices)));
+ Assert.True(card.IsLoaded);
+ Assert.NotNull(page.XamlRoot);
+ Assert.Same(page.XamlRoot, card.XamlRoot);
Assert.Equal(["openclaw.setup.detect"], transport.MethodCalls);
Assert.Equal(0, completed());
});
From 2e71c1d01c8c4066e60c3109ba06e20f48fb3db0 Mon Sep 17 00:00:00 2001
From: Codex local candidate
Date: Wed, 11 Nov 2026 07:52:59 +0000
Subject: [PATCH 5/6] chore: remove redundant Inno metadata comments
---
.../Helpers/InnoInstallationMetadata.cs | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs b/src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs
index 71e8660715..840851e98c 100644
--- a/src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs
+++ b/src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs
@@ -6,7 +6,6 @@ namespace OpenClawTray.Helpers;
///
/// Refreshes the display metadata that Inno cannot update when Updatum replaces files.
-/// The installer still owns registration creation and all uninstall behavior.
///
[SupportedOSPlatform("windows")]
internal sealed class InnoInstallationMetadata
@@ -17,7 +16,6 @@ internal sealed class InnoInstallationMetadata
private const string DisplayNamePrefix = "OpenClaw Companion version ";
private readonly Func _openRegistration;
- // The registry opener is the OS boundary; tests use a task-owned HKCU subtree.
internal InnoInstallationMetadata(Func? openRegistration = null)
{
_openRegistration = openRegistration ??
@@ -41,7 +39,7 @@ internal InnoInstallationMetadata(Func? openRegistration = null)
var directory = Path.GetDirectoryName(executablePath)!;
using var key = _openRegistration();
if (key is null)
- return null; // Portable runs never create an installation record.
+ return null;
var location = ReadString(key, "InstallLocation");
var displayName = ReadString(key, "DisplayName");
@@ -55,9 +53,6 @@ location is null ||
displayVersion is null)
return null;
- // Do not use migration admission here: it intentionally rejects the stale
- // version this startup repair owns. Never rewrite identity or uninstall fields.
- // Separate value writes may be interrupted; the next startup repairs either field.
if (displayVersion != version)
key.SetValue("DisplayVersion", version, RegistryValueKind.String);
var expectedName = DisplayNamePrefix + version;
From c9437981f0db20473da74bae424849938c6e2dcc Mon Sep 17 00:00:00 2001
From: Codex local candidate
Date: Wed, 11 Nov 2026 12:41:59 +0000
Subject: [PATCH 6/6] chore: remove redundant Inno metadata summary
---
src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs b/src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs
index 840851e98c..68fc1bea8a 100644
--- a/src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs
+++ b/src/OpenClaw.Tray.WinUI/Helpers/InnoInstallationMetadata.cs
@@ -4,9 +4,6 @@
namespace OpenClawTray.Helpers;
-///
-/// Refreshes the display metadata that Inno cannot update when Updatum replaces files.
-///
[SupportedOSPlatform("windows")]
internal sealed class InnoInstallationMetadata
{