From e3afc92924314d8d020116fb9613597121c9fdd7 Mon Sep 17 00:00:00 2001 From: pizzaboxer <41478239+pizzaboxer@users.noreply.github.com> Date: Fri, 30 Sep 2022 15:41:01 +0100 Subject: [PATCH] Fix error caused by read-only mod files --- Bloxstrap/Bootstrapper.cs | 1 + Bloxstrap/Dialogs/BootstrapperStyles/BootstrapperStyleForm.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 269dd3c..f6e3670 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -510,6 +510,7 @@ namespace Bloxstrap Directory.CreateDirectory(directory); File.Copy(fileModFolder, fileVersionFolder, true); + File.SetAttributes(fileVersionFolder, File.GetAttributes(fileModFolder) & ~FileAttributes.ReadOnly); } // now check for files that have been deleted from the mod folder diff --git a/Bloxstrap/Dialogs/BootstrapperStyles/BootstrapperStyleForm.cs b/Bloxstrap/Dialogs/BootstrapperStyles/BootstrapperStyleForm.cs index 09b7881..1c41347 100644 --- a/Bloxstrap/Dialogs/BootstrapperStyles/BootstrapperStyleForm.cs +++ b/Bloxstrap/Dialogs/BootstrapperStyles/BootstrapperStyleForm.cs @@ -82,6 +82,9 @@ namespace Bloxstrap.Dialogs.BootstrapperStyles if (Bootstrapper is null) return; +#if DEBUG + await Bootstrapper.Run(); +#else try { await Bootstrapper.Run(); @@ -92,6 +95,7 @@ namespace Bloxstrap.Dialogs.BootstrapperStyles string message = ex.ToString(); ShowError(message); } +#endif } public virtual void ShowSuccess(string message)