From ccc8a12150f811cf43a41cb9593ea5efe4b323a9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 29 May 2013 10:23:27 -0400 Subject: [PATCH] added error handling to the startup wizard --- .../EntryPoints/StartupWizard.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.ServerApplication/EntryPoints/StartupWizard.cs b/MediaBrowser.ServerApplication/EntryPoints/StartupWizard.cs index 43d9018a18..22ec16b024 100644 --- a/MediaBrowser.ServerApplication/EntryPoints/StartupWizard.cs +++ b/MediaBrowser.ServerApplication/EntryPoints/StartupWizard.cs @@ -2,7 +2,10 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Plugins; +using MediaBrowser.Model.Logging; +using System.ComponentModel; using System.Linq; +using System.Windows; namespace MediaBrowser.ServerApplication.EntryPoints { @@ -19,6 +22,7 @@ namespace MediaBrowser.ServerApplication.EntryPoints /// The _user manager /// private readonly IUserManager _userManager; + private readonly ILogger _logger; private readonly IServerConfigurationManager _configurationManager; @@ -52,7 +56,16 @@ namespace MediaBrowser.ServerApplication.EntryPoints { var user = _userManager.Users.FirstOrDefault(u => u.Configuration.IsAdministrator); - App.OpenDashboardPage("wizardStart.html", user, _configurationManager); + try + { + App.OpenDashboardPage("wizardStart.html", user, _configurationManager); + } + catch (Win32Exception ex) + { + _logger.ErrorException("Error launching startup wizard", ex); + + MessageBox.Show("There was an error launching the Media Browser startup wizard. Please ensure a web browser is installed on the machine and is configured as the default browser.", "Media Browser"); + } } ///