Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions companion/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,6 @@ async fn restart_claude_desktop() -> Result<setup::StepResult, String> {
use std::path::PathBuf;
use std::process::Command;

// Best-effort graceful close (no `/F`). If Claude is already gone
// taskkill returns exit code 128 — we don't surface that.
let _ = no_window(
Command::new("taskkill").args(["/IM", "Claude.exe"]),
)
.output();

// Capture the path of the running Claude.exe *before* we tell it
// to quit — that's the most reliable way to find the right binary
// (covers MSIX/Store installs, custom install dirs, renames),
Expand All @@ -525,6 +518,14 @@ async fn restart_claude_desktop() -> Result<setup::StepResult, String> {
// existing candidate path, which silently picks the older binary
// when both NSIS and MSIX installs coexist (mid-upgrade), and
// misses Store-installed Claudes entirely.
//
// History: an earlier taskkill block was duplicated *above* the
// sysinfo lookup at some point between v0.4.40 and v0.4.46, which
// defeated the whole point — by the time sysinfo ran, Claude was
// already gone and the fallback paths ended up being the only
// resolution. Codex spotted the regression in the v0.4.40→main
// audit. The single, post-capture taskkill below is the
// intended order.
let running_exe: Option<PathBuf> = {
use sysinfo::{ProcessRefreshKind, RefreshKind, System};
let sys = System::new_with_specifics(
Expand Down
Loading