From 24e770f3b225cb23345e69139c8626dc3ca5e789 Mon Sep 17 00:00:00 2001 From: Damon Yu Date: Sun, 30 Jul 2023 11:17:45 +0800 Subject: [PATCH] fix race condition via delete file directly --- src/Squirrel/UpdateManager.ApplyReleases.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Squirrel/UpdateManager.ApplyReleases.cs b/src/Squirrel/UpdateManager.ApplyReleases.cs index 3304787ff..6649a40bc 100644 --- a/src/Squirrel/UpdateManager.ApplyReleases.cs +++ b/src/Squirrel/UpdateManager.ApplyReleases.cs @@ -320,9 +320,9 @@ await ReleasePackage.ExtractZipForInstall( progressCallback); // Delete the .not-finished file after extraction is completed - if (File.Exists(notFinishedFilePath)) { + this.ErrorIfThrows(() => { File.Delete(notFinishedFilePath); - } + }, "Couldn't delete file: " + notFinishedFilePath); return target.FullName; });