mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-10-31 09:20:21 +00:00
db0920d921
move all invariant assets to common repo remove ded code, libuv patches can be swapped in at build time for debug/release builds
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using System.Threading;
|
|
using System.Windows.Forms;
|
|
|
|
namespace network.loki.lokinet.win32.ui
|
|
{
|
|
static class Program
|
|
{
|
|
public static OperatingSystem os_id = Environment.OSVersion;
|
|
public static PlatformID platform = os_id.Platform;
|
|
/// <summary>
|
|
/// The main entry point for the application.
|
|
/// </summary>
|
|
[STAThread]
|
|
static void Main()
|
|
{
|
|
// Scrub any old lokinet process left behind
|
|
Mutex m = new Mutex(true, "lokinet_dotnet_ui");
|
|
Process[] old_pids = Process.GetProcessesByName("lokinet");
|
|
foreach (Process pid in old_pids)
|
|
{
|
|
try
|
|
{
|
|
pid.Kill();
|
|
}
|
|
catch { } // don't yell
|
|
}
|
|
Application.EnableVisualStyles();
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
Application.Run(new main_frame());
|
|
try
|
|
{
|
|
main_frame.lokiNetDaemon.Kill();
|
|
}
|
|
catch
|
|
{ }
|
|
m.ReleaseMutex();
|
|
}
|
|
}
|
|
}
|