Repository navigation
Expand file tree
/
Copy pathProgram.cs
More file actions
44 lines (39 loc) · 1.35 KB
/
Copy pathProgram.cs
File metadata and controls
44 lines (39 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using Elect.Gen.pages;
using System.Reflection;
namespace Elect.Gen
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
checkCore();
Application.Run(new pages.MainForm());
}
static void checkCore()
{
string fileName = "DistributorCore.dll";
if(System.IO.File.Exists(fileName))
return;
Assembly assembly = Assembly.GetExecutingAssembly();
string resourceFullName = $"Elect.Gen.StaticFiles.{fileName}";
using (Stream resourceStream = assembly.GetManifestResourceStream(resourceFullName))
{
if (resourceStream == null)
{
throw new Exception($"Ðåñóðñ {resourceFullName} íå íàéäåí.");
}
using (FileStream fileStream = new FileStream(fileName, FileMode.Create, FileAccess.Write))
{
resourceStream.CopyTo(fileStream);
}
}
}
}
}