feat(installer): add WPF installer/configurator project
Standalone WPF app (ClaudeDo.Installer) that handles full installation and ongoing configuration of ClaudeDo. Two modes: wizard for first run, tabbed settings panel for subsequent launches. Page-based extensibility via IInstallerPage interface — adding new config sections requires only one new class. Install pipeline: dotnet publish, deploy binaries, write configs, init DB (via SchemaInitializer from ClaudeDo.Data), register Windows Service, create shortcuts. Dark theme matching the Avalonia app (forest teal accent). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
41
src/ClaudeDo.Installer/Pages/PathsPage/PathsPageView.xaml
Normal file
41
src/ClaudeDo.Installer/Pages/PathsPage/PathsPageView.xaml
Normal file
@@ -0,0 +1,41 @@
|
||||
<UserControl x:Class="ClaudeDo.Installer.Pages.PathsPage.PathsPageView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:ClaudeDo.Installer.Pages.PathsPage"
|
||||
d:DataContext="{d:DesignInstance local:PathsPageViewModel}"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel MaxWidth="520">
|
||||
<TextBlock Text="Data Paths" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="Configure where ClaudeDo stores its data."
|
||||
Foreground="{StaticResource TextSecondaryBrush}" Margin="0,0,0,20"
|
||||
TextWrapping="Wrap"/>
|
||||
|
||||
<Label Content="Database Path"/>
|
||||
<TextBox Text="{Binding DbPath, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,0,12"/>
|
||||
|
||||
<Label Content="Log Directory"/>
|
||||
<TextBox Text="{Binding LogRoot, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,0,12"/>
|
||||
|
||||
<Label Content="Sandbox Root"/>
|
||||
<TextBox Text="{Binding SandboxRoot, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,0,12"/>
|
||||
|
||||
<Label Content="Worktree Strategy"/>
|
||||
<ComboBox SelectedItem="{Binding WorktreeRootStrategy}" Margin="0,0,0,12">
|
||||
<sys:String xmlns:sys="clr-namespace:System;assembly=mscorlib">sibling</sys:String>
|
||||
<sys:String xmlns:sys="clr-namespace:System;assembly=mscorlib">central</sys:String>
|
||||
</ComboBox>
|
||||
|
||||
<StackPanel Visibility="{Binding IsCentralVisible, Converter={StaticResource BoolToVisConverter}}">
|
||||
<Label Content="Central Worktree Root"/>
|
||||
<TextBox Text="{Binding CentralWorktreeRoot, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,0,12"/>
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="{Binding ValidationError}" Foreground="{StaticResource ErrorBrush}" FontSize="11"
|
||||
Visibility="{Binding ValidationError, Converter={StaticResource NullToCollapsedConverter}}"/>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace ClaudeDo.Installer.Pages.PathsPage;
|
||||
|
||||
public partial class PathsPageView : UserControl
|
||||
{
|
||||
public PathsPageView() => InitializeComponent();
|
||||
}
|
||||
74
src/ClaudeDo.Installer/Pages/PathsPage/PathsPageViewModel.cs
Normal file
74
src/ClaudeDo.Installer/Pages/PathsPage/PathsPageViewModel.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System.Windows.Controls;
|
||||
using ClaudeDo.Installer.Core;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace ClaudeDo.Installer.Pages.PathsPage;
|
||||
|
||||
public partial class PathsPageViewModel : ObservableObject, IInstallerPage
|
||||
{
|
||||
private readonly InstallContext _context;
|
||||
private PathsPageView? _view;
|
||||
|
||||
public string Title => "Paths";
|
||||
public string Icon => "\uE8B7";
|
||||
public int Order => 1;
|
||||
public bool ShowInWizard => true;
|
||||
public bool ShowInSettings => true;
|
||||
public UserControl View => _view ??= new PathsPageView { DataContext = this };
|
||||
|
||||
[ObservableProperty] private string _dbPath = "~/.todo-app/todo.db";
|
||||
[ObservableProperty] private string _logRoot = "~/.todo-app/logs";
|
||||
[ObservableProperty] private string _sandboxRoot = "~/.todo-app/sandbox";
|
||||
[ObservableProperty] private string _worktreeRootStrategy = "sibling";
|
||||
[ObservableProperty] private string _centralWorktreeRoot = "~/.todo-app/worktrees";
|
||||
[ObservableProperty] private string? _validationError;
|
||||
|
||||
public bool IsCentralVisible => WorktreeRootStrategy == "central";
|
||||
|
||||
public PathsPageViewModel(InstallContext context) => _context = context;
|
||||
|
||||
partial void OnWorktreeRootStrategyChanged(string value) =>
|
||||
OnPropertyChanged(nameof(IsCentralVisible));
|
||||
|
||||
public Task LoadAsync()
|
||||
{
|
||||
var cfg = InstallerWorkerConfig.Load();
|
||||
DbPath = cfg.DbPath;
|
||||
LogRoot = cfg.LogRoot;
|
||||
SandboxRoot = cfg.SandboxRoot;
|
||||
WorktreeRootStrategy = cfg.WorktreeRootStrategy;
|
||||
CentralWorktreeRoot = cfg.CentralWorktreeRoot;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task ApplyAsync()
|
||||
{
|
||||
_context.DbPath = DbPath;
|
||||
_context.UiDbPath = DbPath;
|
||||
_context.LogRoot = LogRoot;
|
||||
_context.SandboxRoot = SandboxRoot;
|
||||
_context.WorktreeRootStrategy = WorktreeRootStrategy;
|
||||
_context.CentralWorktreeRoot = CentralWorktreeRoot;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public bool Validate()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(DbPath) ||
|
||||
string.IsNullOrWhiteSpace(LogRoot) ||
|
||||
string.IsNullOrWhiteSpace(SandboxRoot))
|
||||
{
|
||||
ValidationError = "All path fields are required.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (WorktreeRootStrategy == "central" && string.IsNullOrWhiteSpace(CentralWorktreeRoot))
|
||||
{
|
||||
ValidationError = "Central worktree root is required when using central strategy.";
|
||||
return false;
|
||||
}
|
||||
|
||||
ValidationError = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user