Browse Source

added error handling to the startup wizard

Luke Pulverenti 12 years ago
parent
commit
ccc8a12150
1 changed files with 14 additions and 1 deletions
  1. 14 1
      MediaBrowser.ServerApplication/EntryPoints/StartupWizard.cs

+ 14 - 1
MediaBrowser.ServerApplication/EntryPoints/StartupWizard.cs

@@ -2,7 +2,10 @@
 using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Plugins;
 using MediaBrowser.Controller.Plugins;
+using MediaBrowser.Model.Logging;
+using System.ComponentModel;
 using System.Linq;
 using System.Linq;
+using System.Windows;
 
 
 namespace MediaBrowser.ServerApplication.EntryPoints
 namespace MediaBrowser.ServerApplication.EntryPoints
 {
 {
@@ -19,6 +22,7 @@ namespace MediaBrowser.ServerApplication.EntryPoints
         /// The _user manager
         /// The _user manager
         /// </summary>
         /// </summary>
         private readonly IUserManager _userManager;
         private readonly IUserManager _userManager;
+        private readonly ILogger _logger;
 
 
         private readonly IServerConfigurationManager _configurationManager;
         private readonly IServerConfigurationManager _configurationManager;
 
 
@@ -52,7 +56,16 @@ namespace MediaBrowser.ServerApplication.EntryPoints
         {
         {
             var user = _userManager.Users.FirstOrDefault(u => u.Configuration.IsAdministrator);
             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");
+            }
         }
         }
 
 
         /// <summary>
         /// <summary>