dotcomboom / AutoSite

Desktop static site generator
http://autosite.somnolescent.net
MIT License
31 stars 2 forks source link

Exception when viewing in default browser if index.html is missing #13

Closed mariteaux closed 5 years ago

mariteaux commented 5 years ago

If I try to view my site in Vivaldi using the Apricot pane without an index.html in the project, I get a missing file error. If I make an index.html, this error goes away. Maybe have it check for the index.html and if it's not there, just open up the entire directory in the browser?

************** Exception Text **************
System.ComponentModel.Win32Exception: The system cannot find the file specified
   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at AutoSite_XL.Form1.BrowseOutputExt_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, 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.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.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9145 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
AutoSite XL
    Assembly Version: 0.9.3.0
    Win32 Version: 0.0.0.0
    CodeBase: file:///C:/Users/mariteaux/Downloads/AutoSite.XL.0.9.3/AutoSite%20XL.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 8.0.0.0
    Win32 Version: 8.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9145 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9136 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
FastColoredTextBox
    Assembly Version: 2.16.26.0
    Win32 Version: 2.16.26.0
    CodeBase: file:///C:/Users/mariteaux/Downloads/AutoSite.XL.0.9.3/FastColoredTextBox.DLL
----------------------------------------
CommonMark
    Assembly Version: 0.1.0.0
    Win32 Version: 0.1.0.0
    CodeBase: file:///C:/Users/mariteaux/Downloads/AutoSite.XL.0.9.3/CommonMark.DLL
----------------------------------------
dotcomboom commented 5 years ago

Handled this by checking if there's an index first. If it doesn't exist, then it will just open up Windows Explorer to the output (identical to the Open Output Folder button) as there isn't a perfect way to detect the default browser under .NET as it seems.