From 720a28ead5871459824ef8497ea1f075ce94ef7b Mon Sep 17 00:00:00 2001 From: pointfeev Date: Sun, 29 Jan 2023 20:38:34 -0500 Subject: [PATCH] Update Resources.cs --- CreamInstaller/Resources/Resources.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CreamInstaller/Resources/Resources.cs b/CreamInstaller/Resources/Resources.cs index b03ec93..b8f0b7c 100644 --- a/CreamInstaller/Resources/Resources.cs +++ b/CreamInstaller/Resources/Resources.cs @@ -439,16 +439,17 @@ internal static class Resources internal static void WriteManifestResource(this string resourceIdentifier, string filePath) { - using Stream resource = Assembly.GetExecutingAssembly().GetManifestResourceStream("CreamInstaller.Resources." + resourceIdentifier); while (!Program.Canceled) try { + using Stream resource = Assembly.GetExecutingAssembly().GetManifestResourceStream("CreamInstaller.Resources." + resourceIdentifier); using FileStream file = new(filePath, FileMode.Create, FileAccess.Write); resource?.CopyTo(file); + break; } catch { - if (filePath.IOWarn("Failed to write a crucial manifest resource") is not DialogResult.OK) + if (filePath.IOWarn("Failed to write a crucial manifest resource (" + resourceIdentifier + ")") is not DialogResult.OK) break; } } @@ -460,6 +461,7 @@ internal static class Resources { using FileStream fileStream = new(filePath, FileMode.Create, FileAccess.Write); fileStream.Write(resource); + break; } catch {