-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Program.cs
68 lines (63 loc) · 2.56 KB
/
Program.cs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using Pterodactyl.Forms;
using Pterodactyl.Managers;
namespace Pterodactyl
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
public static string AppVersion = "1.0.0";
public static LoggerManager logger = new LoggerManager();
public static string osVersion;
public static string osDescription;
public static string cpuArchitecture;
public static string osArchitecture;
public static string mcascii = @"
_____ _ _ _ _
| __ \| | | | | | | |
| |__) | |_ ___ _ __ ___ __| | __ _ ___| |_ _ _| |
| ___/| __/ _ \ '__/ _ \ / _` |/ _` |/ __| __| | | | |
| | | || __/ | | (_) | (_| | (_| | (__| |_| |_| | |
|_| \__\___|_| \___/ \__,_|\__,_|\___|\__|\__, |_|
__/ |
|___/
";
[STAThread]
public static void Main()
{
ApplicationConfiguration.Initialize();
osVersion = System.Environment.OSVersion.Version.ToString();
osDescription = System.Runtime.InteropServices.RuntimeInformation.OSDescription;
cpuArchitecture = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString();
osArchitecture = System.Environment.Is64BitOperatingSystem ? "64-bit" : "32-bit";
if (!OperatingSystem.IsWindows())
{
logger.Log(LogType.Error, "We are sorry, but we blocked this app from running on any other OS than Windows!");
Application.Exit();
}
if (!File.Exists(Application.StartupPath+ @"\styles.yaml"))
{
string yamlContent = @"
lblappname:
Text: Pterodactyl Panel
";
File.AppendAllText(Application.StartupPath + @"\styles.yaml", yamlContent);
Application.Restart();
}
if (!File.Exists(Application.StartupPath + @"\PteroConsole.exe") && !File.Exists(Application.StartupPath + @"\WinSCP.exe"))
{
Application.Run(new FrmInstallTools());
}
else
{
Application.Run(new FrmLoading());
}
}
public static void Alert(string msg, FrmAlert.enmType type)
{
FrmAlert frm = new FrmAlert();
frm.showAlert(msg, type);
}
}
}