-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
59 lines (55 loc) · 2.28 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
namespace PointBlank.Launcher
{
using DLL;
using DLL.Modul;
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Threading;
using System.Windows.Forms;
internal static class Program
{
[STAThread]
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
using (var frm = new Connection())
{
try
{
if (frm.ShowDialog() == DialogResult.OK)
{
WebClient Web = new WebClient();
if (!File.Exists(Application.StartupPath + @"\pbphonixclient.version"))
{
MessageBox.Show("ไม่พบไฟล์ดังกล่าว.", Modul.Name, MessageBoxButtons.OK, MessageBoxIcon.Error);
if (MessageBox.Show("กำลังดาวน์โหลดไฟล์ที่หายไป...", Modul.Name, MessageBoxButtons.OK, MessageBoxIcon.Warning) == DialogResult.OK)
{
Web.DownloadFile(Modul.WEB + "launcher/file/pbphonixclient.version", "pbphonixclient.version");
Application.Restart();
}
}
else
{
LauncherModul.LastVersion = int.Parse(new Launcher(frm, new AuthModul()).Web.DownloadString(Modul.WEB + "launcher/versions/last_launcher_version.txt"));
if (File.ReadAllText(Application.StartupPath + "\\lckuyrai.version") != LauncherModul.LastVersion.ToString())
{
Process.Start(Application.StartupPath + @"\PBUpdate.exe");
}
else
{
Application.Run(new Launcher(frm, new AuthModul()));
}
}
}
}
catch
{
frm.Close();
}
}
}
}
}