Skip to content

Commit 102097e

Browse files
committed
Show errors in AppMan when starting...
1 parent ca53a0c commit 102097e

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

External/Tools/AppMan/Program.cs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,27 @@ static class Program
1919
[STAThread]
2020
static void Main(String[] args)
2121
{
22-
if (mutex.WaitOne(TimeSpan.Zero, true))
22+
try
2323
{
24-
Application.EnableVisualStyles();
25-
Application.SetCompatibleTextRenderingDefault(false);
26-
Application.Run(new MainForm(args));
27-
mutex.ReleaseMutex();
24+
if (mutex.WaitOne(TimeSpan.Zero, true))
25+
{
26+
Application.EnableVisualStyles();
27+
Application.SetCompatibleTextRenderingDefault(false);
28+
Application.Run(new MainForm(args));
29+
mutex.ReleaseMutex();
30+
}
31+
else if (Array.IndexOf(args, "-minimized") == -1)
32+
{
33+
if (Win32.IsRunningOnMono) MessageBox.Show("AppMan is already running.");
34+
else Win32.PostMessage((IntPtr)Win32.HWND_BROADCAST, Win32.WM_SHOWME, IntPtr.Zero, IntPtr.Zero);
35+
}
2836
}
29-
else if (Array.IndexOf(args, "-minimized") == -1)
37+
catch (Exception ex)
3038
{
31-
if (Win32.IsRunningOnMono) MessageBox.Show("AppMan is already running.");
32-
else Win32.PostMessage((IntPtr)Win32.HWND_BROADCAST, Win32.WM_SHOWME, IntPtr.Zero, IntPtr.Zero);
39+
MessageBox.Show("Error while starting AppMan:\n" + ex.ToString());
3340
}
3441
}
3542

3643
}
3744

3845
}
39-
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)