Update Resources.cs
This commit is contained in:
parent
36570420a4
commit
720a28ead5
1 changed files with 4 additions and 2 deletions
|
@ -439,16 +439,17 @@ internal static class Resources
|
||||||
|
|
||||||
internal static void WriteManifestResource(this string resourceIdentifier, string filePath)
|
internal static void WriteManifestResource(this string resourceIdentifier, string filePath)
|
||||||
{
|
{
|
||||||
using Stream resource = Assembly.GetExecutingAssembly().GetManifestResourceStream("CreamInstaller.Resources." + resourceIdentifier);
|
|
||||||
while (!Program.Canceled)
|
while (!Program.Canceled)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
using Stream resource = Assembly.GetExecutingAssembly().GetManifestResourceStream("CreamInstaller.Resources." + resourceIdentifier);
|
||||||
using FileStream file = new(filePath, FileMode.Create, FileAccess.Write);
|
using FileStream file = new(filePath, FileMode.Create, FileAccess.Write);
|
||||||
resource?.CopyTo(file);
|
resource?.CopyTo(file);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
catch
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -460,6 +461,7 @@ internal static class Resources
|
||||||
{
|
{
|
||||||
using FileStream fileStream = new(filePath, FileMode.Create, FileAccess.Write);
|
using FileStream fileStream = new(filePath, FileMode.Create, FileAccess.Write);
|
||||||
fileStream.Write(resource);
|
fileStream.Write(resource);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue