StartupWizard.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using Emby.Server.Implementations.Browser;
  3. using MediaBrowser.Controller;
  4. using MediaBrowser.Controller.Plugins;
  5. using MediaBrowser.Model.Logging;
  6. using MediaBrowser.Controller.Configuration;
  7. namespace Emby.Server.Implementations.EntryPoints
  8. {
  9. /// <summary>
  10. /// Class StartupWizard
  11. /// </summary>
  12. public class StartupWizard : IServerEntryPoint
  13. {
  14. /// <summary>
  15. /// The _app host
  16. /// </summary>
  17. private readonly IServerApplicationHost _appHost;
  18. /// <summary>
  19. /// The _user manager
  20. /// </summary>
  21. private readonly ILogger _logger;
  22. private IServerConfigurationManager _config;
  23. public StartupWizard(IServerApplicationHost appHost, ILogger logger, IServerConfigurationManager config)
  24. {
  25. _appHost = appHost;
  26. _logger = logger;
  27. _config = config;
  28. }
  29. /// <summary>
  30. /// Runs this instance.
  31. /// </summary>
  32. public void Run()
  33. {
  34. if (_appHost.IsFirstRun)
  35. {
  36. BrowserLauncher.OpenDashboardPage("wizardstart.html", _appHost);
  37. }
  38. else if (_config.Configuration.IsStartupWizardCompleted)
  39. {
  40. BrowserLauncher.OpenDashboardPage("index.html", _appHost);
  41. }
  42. }
  43. /// <summary>
  44. /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
  45. /// </summary>
  46. public void Dispose()
  47. {
  48. GC.SuppressFinalize(this);
  49. }
  50. }
  51. }