blish-hud / Blish-HUD

A Guild Wars 2 overlay with extreme extensibility through compiled modules.
https://blishhud.com
MIT License
320 stars 59 forks source link

Catch exceptions when attempting to launch gw2. #868

Closed dlamkins closed 1 year ago

dlamkins commented 1 year ago

We currently check to see if the gw2 exe exists and then just call it. We need to add some error handling around this for cases where the exe is just wrong (in this case, it looks like it was a 0 byte file and the real exe was in the directory with a double extension somehow).

System.ComponentModel.Win32Exception (0x80004005): The specified executable is not a valid application for this OS platform. at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

** Loaded Assemblies **

dlamkins commented 1 year ago

Fixed in #875