From dc807dd048d650fb4b308297b44b7871b0c2e6f3 Mon Sep 17 00:00:00 2001 From: SaladDay <1203511142@qq.com> Date: Fri, 23 Oct 2026 18:45:01 +0000 Subject: [PATCH] Remove the Windows installation after uninstall finishes --- apps/daemon/internal/cli/native_uninstall.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/daemon/internal/cli/native_uninstall.go b/apps/daemon/internal/cli/native_uninstall.go index 4e875d730..2ac1bf340 100644 --- a/apps/daemon/internal/cli/native_uninstall.go +++ b/apps/daemon/internal/cli/native_uninstall.go @@ -107,8 +107,9 @@ func runUninstall(rc *runContext, args []string) error { // Only empty directories go; anything left belongs to the user. _ = os.Remove(filepath.Join(root, "daemon")) if kept { - // Windows keeps the running executable open until this process exits. - deleteAfterExit(root) + // Windows keeps the running executable open until this process exits; + // the helper starts last so its short wait begins at exit. + defer deleteAfterExit(root) } else { _ = os.Remove(root) }