From e09bc097748d9b34c2d56aa835c8d42476bf0469 Mon Sep 17 00:00:00 2001 From: Paulov Date: Tue, 7 May 2024 18:37:18 +0100 Subject: [PATCH] Fix not-empty logs directory & launcher directory requirement --- SIT.Manager/Services/Install/InstallerService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SIT.Manager/Services/Install/InstallerService.cs b/SIT.Manager/Services/Install/InstallerService.cs index 5d6a4d8c..f1ac008f 100644 --- a/SIT.Manager/Services/Install/InstallerService.cs +++ b/SIT.Manager/Services/Install/InstallerService.cs @@ -86,7 +86,7 @@ private void CleanUpEFTDirectory() string logsDirPath = Path.Combine(_configService.Config.SitEftInstallPath, "Logs"); if (Directory.Exists(logsDirPath)) { - Directory.Delete(logsDirPath); + Directory.Delete(logsDirPath, true); } } catch (Exception ex) @@ -657,7 +657,9 @@ public async Task InstallSit(GithubRelease selectedVersion, string targetInstall var coreFilesPath = Path.Combine(targetInstallDir, "SITLauncher", "CoreFiles"); // Recursively delete all downloaded files / folders - Directory.Delete(coreFilesPath, true); + if(Directory.Exists(coreFilesPath)) + Directory.Delete(coreFilesPath, true); + // Recreate directory for downloaded files / folders Directory.CreateDirectory(coreFilesPath);