From 6d5c73fe98ebff4320a30cf7acac7b62617576b8 Mon Sep 17 00:00:00 2001 From: camileko Date: Mon, 21 Sep 2026 01:06:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=B1=E8=B4=A5=E5=92=8C?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=BB=A5=E5=A4=96=E5=A4=9A=E4=BD=99=E7=9A=84?= =?UTF-8?q?1s=E7=AD=89=E5=BE=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Pages/PageDownload/ModDownloadLib.vb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.vb b/Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.vb index c1e0c69..852556f 100644 --- a/Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.vb +++ b/Plain Craft Launcher 2/Pages/PageDownload/ModDownloadLib.vb @@ -1814,15 +1814,14 @@ Retry: End Sub Public Sub McInstallFailedClearFolder(Loader) Try + If Loader.State <> LoadState.Failed AndAlso Loader.State <> LoadState.Canceled Then Return Thread.Sleep(1000) '防止存在尚未完全释放的文件,导致清理失败(例如整合包安装) - If Loader.State = LoadState.Failed OrElse Loader.State = LoadState.Canceled Then - '删除版本文件夹 - If DirectoryUtils.Exists(Loader.Input & "saves\") OrElse DirectoryUtils.Exists(Loader.Input & "versions\") Then - Logger.Warn($"由于版本已被独立启动,不清理版本文件夹:{Loader.Input}") - Else - Logger.Warn($"由于下载失败或取消,清理版本文件夹:{Loader.Input}") - DirectoryUtils.Delete(Loader.Input) - End If + '删除版本文件夹 + If DirectoryUtils.Exists(Loader.Input & "saves\") OrElse DirectoryUtils.Exists(Loader.Input & "versions\") Then + Logger.Warn($"由于版本已被独立启动,不清理版本文件夹:{Loader.Input}") + Else + Logger.Warn($"由于下载失败或取消,清理版本文件夹:{Loader.Input}") + DirectoryUtils.Delete(Loader.Input) End If Catch ex As Exception Logger.Warn(ex, "下载失败或取消后清理版本文件夹失败")