From 59d1077e2853e1964ae27a3158eaa80e01d690ee Mon Sep 17 00:00:00 2001 From: Andrew Lytvynov Date: Thu, 30 Nov 2023 14:22:29 -0600 Subject: [PATCH] clientupdate: cleanup tailscale binary copies on Windows (#10433) When updating on Windows, we make a copy of the tailscale.exe file in a temp directory to perform the update, because the original tailscale.exe gets deleted during the update. This can eat up disk space if a machine is stuck doing repeated failed update attempts. Clean up old copies explicitly before making a new one, same as we do with MSIs. Updates #10082 Signed-off-by: Andrew Lytvynov --- clientupdate/clientupdate.go | 1 + 1 file changed, 1 insertion(+) diff --git a/clientupdate/clientupdate.go b/clientupdate/clientupdate.go index 7584a7d61..e2079a113 100644 --- a/clientupdate/clientupdate.go +++ b/clientupdate/clientupdate.go @@ -765,6 +765,7 @@ you can run the command prompt as Administrator one of these ways: up.Logf("authenticode verification succeeded") up.Logf("making tailscale.exe copy to switch to...") + up.cleanupOldDownloads(filepath.Join(os.TempDir(), "tailscale-updater-*.exe")) selfOrig, selfCopy, err := makeSelfCopy() if err != nil { return err