-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
49 lines (43 loc) · 1.64 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
using LibGit2Sharp;
using System;
using System.IO;
using System.Threading;
using System.Windows.Forms;
namespace SNESMiniLuaCompiler
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
bool hasModulesPath = Directory.Exists(AppUtils.modulesPath);
if (!hasModulesPath)
Directory.CreateDirectory(AppUtils.modulesPath);
bool emptyModules = Directory.GetFileSystemEntries(AppUtils.modulesPath).Length == 0;
using (Mutex mutex = new Mutex(true, "SNESMiniLuaCompiler", out bool singleExecution))
{
if (singleExecution)
{
if (!hasModulesPath || emptyModules)
{
Repository.Clone("https://github.com/bobsayshilol/luajit-decomp.git", AppUtils.luaJitPath, new CloneOptions { BranchName = "deprecated" });
Repository.Clone("https://gitlab.com/znixian/luajit-decompiler.git", AppUtils.decompilerPath);
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
using (MainForm mainWindow = new MainForm())
{
Application.Run(mainWindow);
}
}
else
{
MsgBox.Show("The Application Is Already Running", "Lua Compiler", MsgBox.ButtonType.OK, MsgBox.Ico.Warning);
}
}
}
}
}