Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4148dcdb18 | ||
|
|
5783790733 |
@@ -84,6 +84,15 @@ public partial class InstallPageViewModel : ObservableObject, IInstallerPage
|
|||||||
{
|
{
|
||||||
if (IsInstalling) return;
|
if (IsInstalling) return;
|
||||||
|
|
||||||
|
// Reset per-step state so a re-run starts clean instead of appending
|
||||||
|
// output to the previous run's messages.
|
||||||
|
foreach (var s in Steps)
|
||||||
|
{
|
||||||
|
s.Messages.Clear();
|
||||||
|
s.Status = StepStatus.Pending;
|
||||||
|
s.IsExpanded = false;
|
||||||
|
}
|
||||||
|
|
||||||
IsInstalling = true;
|
IsInstalling = true;
|
||||||
IsComplete = false;
|
IsComplete = false;
|
||||||
HasErrors = false;
|
HasErrors = false;
|
||||||
@@ -96,6 +105,10 @@ public partial class InstallPageViewModel : ObservableObject, IInstallerPage
|
|||||||
var step = Steps.FirstOrDefault(s => s.Name == p.StepName);
|
var step = Steps.FirstOrDefault(s => s.Name == p.StepName);
|
||||||
if (step is null) return;
|
if (step is null) return;
|
||||||
|
|
||||||
|
// Status and output lines arrive on two separate Progress<T> channels, so a
|
||||||
|
// trailing "Running" line-message can be delivered after the step's terminal
|
||||||
|
// Done/Failed. Never let that downgrade a completed step back to Running.
|
||||||
|
if (!(step.Status is StepStatus.Done or StepStatus.Failed && p.Status is StepStatus.Running))
|
||||||
step.Status = p.Status;
|
step.Status = p.Status;
|
||||||
if (p.Message is not null)
|
if (p.Message is not null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,15 +7,21 @@ namespace ClaudeDo.Installer.Steps;
|
|||||||
public sealed class StopWorkerStep : IInstallStep
|
public sealed class StopWorkerStep : IInstallStep
|
||||||
{
|
{
|
||||||
public const string LegacyTaskName = "ClaudeDoWorker";
|
public const string LegacyTaskName = "ClaudeDoWorker";
|
||||||
public const string ProcessName = "ClaudeDo.Worker";
|
|
||||||
|
// Both must be stopped before the install dir is touched: a running app/worker
|
||||||
|
// exe locks its directory, so Directory.Move during extraction would otherwise
|
||||||
|
// fail with "Access to the path '...\app' is denied".
|
||||||
|
private static readonly string[] ProcessNames = { "ClaudeDo.Worker", "ClaudeDo.App" };
|
||||||
|
|
||||||
public string Name => "Stop Worker";
|
public string Name => "Stop Worker";
|
||||||
|
|
||||||
public async Task<StepResult> ExecuteAsync(InstallContext ctx, IProgress<string> progress, CancellationToken ct)
|
public async Task<StepResult> ExecuteAsync(InstallContext ctx, IProgress<string> progress, CancellationToken ct)
|
||||||
{
|
{
|
||||||
progress.Report("Stopping worker process (if running)...");
|
progress.Report("Stopping ClaudeDo processes (if running)...");
|
||||||
var installDir = ctx.InstallDirectory;
|
var installDir = ctx.InstallDirectory;
|
||||||
foreach (var p in Process.GetProcessesByName(ProcessName))
|
foreach (var name in ProcessNames)
|
||||||
|
{
|
||||||
|
foreach (var p in Process.GetProcessesByName(name))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -27,6 +33,7 @@ public sealed class StopWorkerStep : IInstallStep
|
|||||||
catch { /* process may have exited or be inaccessible */ }
|
catch { /* process may have exited or be inaccessible */ }
|
||||||
finally { p.Dispose(); }
|
finally { p.Dispose(); }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
await Task.CompletedTask;
|
await Task.CompletedTask;
|
||||||
return StepResult.Ok();
|
return StepResult.Ok();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user