StartupWizard.cs 1.7 KB

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