|
|
@ -26,7 +26,7 @@ namespace UptimeKuma {
|
|
|
|
if (cwd != null) {
|
|
|
|
if (cwd != null) {
|
|
|
|
Environment.CurrentDirectory = cwd;
|
|
|
|
Environment.CurrentDirectory = cwd;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
Application.EnableVisualStyles();
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
Application.SetCompatibleTextRenderingDefault(false);
|
|
|
|
Application.Run(new UptimeKumaApplicationContext());
|
|
|
|
Application.Run(new UptimeKumaApplicationContext());
|
|
|
@ -42,6 +42,7 @@ namespace UptimeKuma {
|
|
|
|
|
|
|
|
|
|
|
|
private MenuItem statusMenuItem;
|
|
|
|
private MenuItem statusMenuItem;
|
|
|
|
private MenuItem runWhenStarts;
|
|
|
|
private MenuItem runWhenStarts;
|
|
|
|
|
|
|
|
private MenuItem openMenuItem;
|
|
|
|
|
|
|
|
|
|
|
|
private RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
|
|
|
|
private RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
|
|
|
|
|
|
|
|
|
|
|
@ -57,10 +58,13 @@ namespace UptimeKuma {
|
|
|
|
statusMenuItem = new MenuItem(startingText);
|
|
|
|
statusMenuItem = new MenuItem(startingText);
|
|
|
|
statusMenuItem.Enabled = false;
|
|
|
|
statusMenuItem.Enabled = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
openMenuItem = new MenuItem("Open", Open);
|
|
|
|
|
|
|
|
openMenuItem.Enabled = false;
|
|
|
|
|
|
|
|
|
|
|
|
trayIcon.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
|
|
|
|
trayIcon.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
|
|
|
|
trayIcon.ContextMenu = new ContextMenu(new MenuItem[] {
|
|
|
|
trayIcon.ContextMenu = new ContextMenu(new MenuItem[] {
|
|
|
|
statusMenuItem,
|
|
|
|
statusMenuItem,
|
|
|
|
new("Open", Open),
|
|
|
|
openMenuItem,
|
|
|
|
//new("Debug Console", DebugConsole),
|
|
|
|
//new("Debug Console", DebugConsole),
|
|
|
|
runWhenStarts,
|
|
|
|
runWhenStarts,
|
|
|
|
new("Check for Update...", CheckForUpdate),
|
|
|
|
new("Check for Update...", CheckForUpdate),
|
|
|
@ -131,6 +135,7 @@ namespace UptimeKuma {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
tcpClient.Connect("127.0.0.1", 3001);
|
|
|
|
tcpClient.Connect("127.0.0.1", 3001);
|
|
|
|
statusMenuItem.Text = runningText;
|
|
|
|
statusMenuItem.Text = runningText;
|
|
|
|
|
|
|
|
openMenuItem.Enabled = true;
|
|
|
|
trayIcon.Text = runningText;
|
|
|
|
trayIcon.Text = runningText;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
} catch (Exception) {
|
|
|
|
} catch (Exception) {
|
|
|
|