aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ServerApplication/WindowsAppHost.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.ServerApplication/WindowsAppHost.cs')
-rw-r--r--MediaBrowser.ServerApplication/WindowsAppHost.cs110
1 files changed, 11 insertions, 99 deletions
diff --git a/MediaBrowser.ServerApplication/WindowsAppHost.cs b/MediaBrowser.ServerApplication/WindowsAppHost.cs
index ec66923aa..9f11dc322 100644
--- a/MediaBrowser.ServerApplication/WindowsAppHost.cs
+++ b/MediaBrowser.ServerApplication/WindowsAppHost.cs
@@ -4,10 +4,14 @@ using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices.ComTypes;
+using Emby.Server.Connect;
using Emby.Server.Core;
using Emby.Server.Implementations;
using Emby.Server.Implementations.EntryPoints;
using Emby.Server.Implementations.FFMpeg;
+using Emby.Server.Sync;
+using MediaBrowser.Controller.Connect;
+using MediaBrowser.Controller.Sync;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.System;
@@ -27,36 +31,14 @@ namespace MediaBrowser.ServerApplication
get { return MainStartup.IsRunningAsService; }
}
- protected override FFMpegInstallInfo GetFfmpegInstallInfo()
+ protected override IConnectManager CreateConnectManager()
{
- var info = new FFMpegInstallInfo();
-
- info.FFMpegFilename = "ffmpeg.exe";
- info.FFProbeFilename = "ffprobe.exe";
- info.Version = "20160410";
- info.ArchiveType = "7z";
- info.DownloadUrls = GetDownloadUrls();
-
- return info;
+ return new ConnectManager();
}
- private string[] GetDownloadUrls()
+ protected override ISyncManager CreateSyncManager()
{
- switch (EnvironmentInfo.SystemArchitecture)
- {
- case Architecture.X64:
- return new[]
- {
- "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20160410-win64.7z"
- };
- case Architecture.X86:
- return new[]
- {
- "https://github.com/MediaBrowser/Emby.Resources/raw/master/ffmpeg/windows/ffmpeg-20160410-win32.7z"
- };
- }
-
- return new string[] { };
+ return new SyncManager();
}
protected override void RestartInternal()
@@ -73,6 +55,8 @@ namespace MediaBrowser.ServerApplication
//list.Add(typeof(PismoIsoManager).Assembly);
}
+ list.Add(typeof(ConnectManager).Assembly);
+ list.Add(typeof(SyncManager).Assembly);
list.Add(GetType().Assembly);
return list;
@@ -94,7 +78,7 @@ namespace MediaBrowser.ServerApplication
protected override void ConfigureAutoRunInternal(bool autorun)
{
- var startupPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Startup);
+ var startupPath = Environment.GetFolderPath(System.Environment.SpecialFolder.Startup);
if (autorun && !MainStartup.IsRunningAsService)
{
@@ -121,14 +105,6 @@ namespace MediaBrowser.ServerApplication
}
}
- protected override bool SupportsDualModeSockets
- {
- get
- {
- return true;
- }
- }
-
protected override void EnableLoopbackInternal(string appName)
{
LoopUtil.Run(appName);
@@ -150,14 +126,6 @@ namespace MediaBrowser.ServerApplication
}
}
- public override bool SupportsAutoRunAtStartup
- {
- get
- {
- return true;
- }
- }
-
public override bool CanSelfUpdate
{
get
@@ -165,61 +133,5 @@ namespace MediaBrowser.ServerApplication
return MainStartup.CanSelfUpdate;
}
}
-
- public bool PortsRequireAuthorization(string applicationPath)
- {
- var appNameSrch = Path.GetFileName(applicationPath);
-
- var startInfo = new ProcessStartInfo
- {
- FileName = "netsh",
-
- Arguments = "advfirewall firewall show rule \"" + appNameSrch + "\"",
-
- CreateNoWindow = true,
- UseShellExecute = false,
- WindowStyle = ProcessWindowStyle.Hidden,
- ErrorDialog = false,
- RedirectStandardOutput = true
- };
-
- using (var process = Process.Start(startInfo))
- {
- process.Start();
-
- try
- {
- var data = process.StandardOutput.ReadToEnd() ?? string.Empty;
-
- if (data.IndexOf("Block", StringComparison.OrdinalIgnoreCase) != -1)
- {
- Logger.Info("Found potential windows firewall rule blocking Emby Server: " + data);
- }
-
- //var parts = data.Split('\n');
-
- //return parts.Length > 4;
- //return Confirm();
- return false;
- }
- catch (Exception ex)
- {
- Logger.ErrorException("Error querying windows firewall", ex);
-
- // Hate having to do this
- try
- {
- process.Kill();
- }
- catch (Exception ex1)
- {
- Logger.ErrorException("Error killing process", ex1);
- }
-
- throw;
- }
- }
- }
-
}
}