From 835f859fe96ad9368aee4ae4108a80ba33c2322a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Fri, 2 Aug 2024 22:36:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=A9=BA=E5=BD=B1=E5=AD=90=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=89=8D=EF=BC=8C=E9=9C=80=E8=A6=81=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stardust/Deployment/ZipDeploy.cs | 11 +++++++---- Stardust/Stardust.csproj | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Stardust/Deployment/ZipDeploy.cs b/Stardust/Deployment/ZipDeploy.cs index d3755a2e..5c3bec6c 100644 --- a/Stardust/Deployment/ZipDeploy.cs +++ b/Stardust/Deployment/ZipDeploy.cs @@ -411,15 +411,18 @@ public virtual void Extract(String shadow, CopyModes exefile, CopyModes configfi break; case DeployModes.Standard: WriteLog("清空影子目录中的可执行文件"); - foreach (var item in sdi.GetFiles()) + if (sdi.Exists) { - if (IsExe(item.Extension)) - item.Delete(); + foreach (var item in sdi.GetFiles()) + { + if (IsExe(item.Extension)) + item.Delete(); + } } break; case DeployModes.Full: WriteLog("清空影子目录中的所有文件"); - sdi.Delete(true); + if (sdi.Exists) sdi.Delete(true); shadow.EnsureDirectory(false); break; default: diff --git a/Stardust/Stardust.csproj b/Stardust/Stardust.csproj index 254aa518..b9d86ad7 100644 --- a/Stardust/Stardust.csproj +++ b/Stardust/Stardust.csproj @@ -115,7 +115,7 @@ - +