Skip to content

Commit

Permalink
Error Message Box
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisFeline committed Dec 30, 2024
1 parent 2e84d7e commit 8b7d08d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ internal static bool ContainsArg(string arg) {
[STAThread]
static void Main(string[] args)
{
try {
if (CheckMutex()) {
// Don't run program if it's already running, instead we focus the already existing window
NativeMethods.PostMessage((IntPtr)NativeMethods.HWND_BROADCAST, NativeMethods.WM_FOCUSINST, IntPtr.Zero, IntPtr.Zero);
return;
}
if (CheckMutex()) {
// Don't run program if it's already running, instead we focus the already existing window
NativeMethods.PostMessage((IntPtr)NativeMethods.HWND_BROADCAST, NativeMethods.WM_FOCUSINST, IntPtr.Zero, IntPtr.Zero);
return;
}

if (!Directory.Exists(DataLocation)) Directory.CreateDirectory(DataLocation);
if (!Directory.Exists(DataLocation)) Directory.CreateDirectory(DataLocation);

try {
Logger.Log("Initializing logging.");

Directory.SetCurrentDirectory(ProgramDirectory);
Expand Down Expand Up @@ -93,6 +93,7 @@ static void Main(string[] args)
GitHubUpdate.Start();
} catch (Exception e) {
// What the heck happened?
MessageBox.Show(e.ToString(), "APP STARTUP FAILED!");
File.WriteAllText(Path.Combine(DataLocation, "output.error"), e.ToString());
}
}
Expand Down

0 comments on commit 8b7d08d

Please sign in to comment.