2018-12-03 04:35:49 +00:00
|
|
|
|
using System;
|
2019-04-05 02:12:16 +00:00
|
|
|
|
using System.Diagnostics;
|
2020-01-30 07:36:03 +00:00
|
|
|
|
using System.Threading;
|
2018-12-03 04:35:49 +00:00
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2019-03-20 10:02:18 +00:00
|
|
|
|
namespace network.loki.lokinet.win32.ui
|
2018-12-03 04:35:49 +00:00
|
|
|
|
{
|
|
|
|
|
static class Program
|
|
|
|
|
{
|
2019-03-20 10:02:18 +00:00
|
|
|
|
public static OperatingSystem os_id = Environment.OSVersion;
|
|
|
|
|
public static PlatformID platform = os_id.Platform;
|
2018-12-03 04:35:49 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The main entry point for the application.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[STAThread]
|
|
|
|
|
static void Main()
|
|
|
|
|
{
|
2019-04-05 02:12:16 +00:00
|
|
|
|
// Scrub any old lokinet process left behind
|
2020-01-30 07:36:03 +00:00
|
|
|
|
Mutex m = new Mutex(true, "lokinet_dotnet_ui");
|
2019-04-05 02:12:16 +00:00
|
|
|
|
Process[] old_pids = Process.GetProcessesByName("lokinet");
|
|
|
|
|
foreach (Process pid in old_pids)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
pid.Kill();
|
|
|
|
|
}
|
|
|
|
|
catch { } // don't yell
|
|
|
|
|
}
|
2018-12-03 04:35:49 +00:00
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
2019-03-20 10:02:18 +00:00
|
|
|
|
Application.Run(new main_frame());
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
main_frame.lokiNetDaemon.Kill();
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{ }
|
2020-01-30 07:36:03 +00:00
|
|
|
|
m.ReleaseMutex();
|
2018-12-03 04:35:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|