diff --git a/src/ClaudeDo.Ui/Services/InstallerLocator.cs b/src/ClaudeDo.Ui/Services/InstallerLocator.cs index de15542..9651810 100644 --- a/src/ClaudeDo.Ui/Services/InstallerLocator.cs +++ b/src/ClaudeDo.Ui/Services/InstallerLocator.cs @@ -7,7 +7,8 @@ public sealed class InstallerLocator private const string UninstallerSubdir = "uninstaller"; public string? Find() - => FindByWalkingUp(AppContext.BaseDirectory) ?? FindByRegistry(); + => FindByWalkingUp(AppContext.BaseDirectory) + ?? (OperatingSystem.IsWindows() ? FindByRegistry() : null); public string? FindByWalkingUp(string startDir) { diff --git a/src/ClaudeDo.Ui/ViewModels/IslandsShellViewModel.cs b/src/ClaudeDo.Ui/ViewModels/IslandsShellViewModel.cs index 739ded8..1048584 100644 --- a/src/ClaudeDo.Ui/ViewModels/IslandsShellViewModel.cs +++ b/src/ClaudeDo.Ui/ViewModels/IslandsShellViewModel.cs @@ -29,8 +29,8 @@ public sealed partial class IslandsShellViewModel : ViewModelBase public bool IsOffline => Worker?.IsConnected != true && Worker?.IsReconnecting != true; - private readonly UpdateCheckService _updateCheck; - private readonly InstallerLocator _installerLocator; + private readonly UpdateCheckService _updateCheck = null!; + private readonly InstallerLocator _installerLocator = null!; private readonly IDbContextFactory? _dbFactory; private readonly Func _worktreesOverviewVmFactory = () => null!; private readonly Func _mergeVmFactory = () => null!; @@ -297,17 +297,7 @@ public sealed partial class IslandsShellViewModel : ViewModelBase RestartWorkerStatus = "Restarting worker…"; try { - await Task.Run(() => - { - using var sc = new System.ServiceProcess.ServiceController("ClaudeDoWorker"); - if (sc.Status != System.ServiceProcess.ServiceControllerStatus.Stopped) - { - sc.Stop(); - sc.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(20)); - } - sc.Start(); - sc.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Running, TimeSpan.FromSeconds(20)); - }); + await Task.Run(RestartWorkerService); await FlashRestartStatusAsync("Worker restarted."); } catch (InvalidOperationException) @@ -321,6 +311,19 @@ public sealed partial class IslandsShellViewModel : ViewModelBase } } + [System.Runtime.Versioning.SupportedOSPlatform("windows")] + private static void RestartWorkerService() + { + using var sc = new System.ServiceProcess.ServiceController("ClaudeDoWorker"); + if (sc.Status != System.ServiceProcess.ServiceControllerStatus.Stopped) + { + sc.Stop(); + sc.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(20)); + } + sc.Start(); + sc.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Running, TimeSpan.FromSeconds(20)); + } + private async Task FlashRestartStatusAsync(string text) { RestartWorkerStatus = text; diff --git a/src/ClaudeDo.Ui/Views/Controls/ThemedDatePicker.axaml b/src/ClaudeDo.Ui/Views/Controls/ThemedDatePicker.axaml index f20d154..115a0f2 100644 --- a/src/ClaudeDo.Ui/Views/Controls/ThemedDatePicker.axaml +++ b/src/ClaudeDo.Ui/Views/Controls/ThemedDatePicker.axaml @@ -154,7 +154,7 @@ Foreground="{DynamicResource TextDimBrush}" Margin="0,0,8,0"/>