forked from YSRKEN/HSP-Decompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
77 lines (68 loc) · 1.53 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
69
70
71
72
73
74
75
76
77
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
using System.Text;
namespace KttK.HspDecompiler
{
internal static class Program
{
/// <summary>
/// アプリケーションのメイン エントリ ポイントです。
/// </summary>
[STAThread]
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
HspConsole.Initialize();
if (!HspDecoder.Initialize())
{
HspConsole.Close();
return;
}
string filename = null;
if ((args != null) && (args.Length > 0))
{
foreach (string file in args)
{
if (File.Exists(file))
{
filename = file;
break;
}
}
}
try
{
Application.Run(new deHspDialog(filename));
}
catch(Exception e)
{
try
{
HspConsole.ExceptionHandlingClose(e);
}
catch { }
return;
}
HspConsole.Close();
}
private readonly static string exeDir = Path.GetDirectoryName(Application.ExecutablePath) + @"\";
private readonly static string exeName = Path.GetFileName(Application.ExecutablePath);
private readonly static System.Diagnostics.FileVersionInfo exeVer =
System.Diagnostics.FileVersionInfo.GetVersionInfo(Application.ExecutablePath);
internal static string ExeName
{
get { return Program.exeName; }
}
internal static System.Diagnostics.FileVersionInfo ExeVer
{
get { return Program.exeVer; }
}
internal static string ExeDir
{
get { return exeDir; }
}
}
}