aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ServerApplication/Native/WindowsApp.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-04-09 22:32:27 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-04-09 22:32:27 -0400
commit6ea48d1e7c32f159c2e8c92f73f84b09bb78ec3f (patch)
treefd907ec9c752b7c760ab764f74a15b35f6ff660d /MediaBrowser.ServerApplication/Native/WindowsApp.cs
parentbe4f301198fa0d1d455478eebfc960a6e61c33e9 (diff)
parent638dba51ec75f9180c44ec4e75b67f7cea774910 (diff)
Merge branch 'beta'
Diffstat (limited to 'MediaBrowser.ServerApplication/Native/WindowsApp.cs')
-rw-r--r--MediaBrowser.ServerApplication/Native/WindowsApp.cs49
1 files changed, 46 insertions, 3 deletions
diff --git a/MediaBrowser.ServerApplication/Native/WindowsApp.cs b/MediaBrowser.ServerApplication/Native/WindowsApp.cs
index ac07a369d..146a4372b 100644
--- a/MediaBrowser.ServerApplication/Native/WindowsApp.cs
+++ b/MediaBrowser.ServerApplication/Native/WindowsApp.cs
@@ -1,12 +1,13 @@
using MediaBrowser.Common.Net;
-using MediaBrowser.IsoMounter;
using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Startup.Common;
using MediaBrowser.ServerApplication.Networking;
using System.Collections.Generic;
+using System.IO;
using System.Reflection;
using CommonIO;
using MediaBrowser.Controller.Power;
+using MediaBrowser.Server.Startup.Common.FFMpeg;
namespace MediaBrowser.ServerApplication.Native
{
@@ -31,7 +32,7 @@ namespace MediaBrowser.ServerApplication.Native
}
list.Add(GetType().Assembly);
-
+
return list;
}
@@ -108,7 +109,22 @@ namespace MediaBrowser.ServerApplication.Native
public void ConfigureAutoRun(bool autorun)
{
- Autorun.Configure(autorun, _fileSystem);
+ var shortcutPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.StartMenu), "Emby", "Emby Server.lnk");
+
+ var startupPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Startup);
+
+ if (autorun)
+ {
+ //Copy our shortut into the startup folder for this user
+ var targetPath = Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "Emby Server.lnk");
+ _fileSystem.CreateDirectory(Path.GetDirectoryName(targetPath));
+ File.Copy(shortcutPath, targetPath, true);
+ }
+ else
+ {
+ //Remove our shortcut from the startup folder for this user
+ _fileSystem.DeleteFile(Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "Emby Server.lnk"));
+ }
}
public INetworkManager CreateNetworkManager(ILogger logger)
@@ -125,5 +141,32 @@ namespace MediaBrowser.ServerApplication.Native
{
return new WindowsPowerManagement(_logger);
}
+
+ public FFMpegInstallInfo GetFfmpegInstallInfo()
+ {
+ var info = new FFMpegInstallInfo();
+
+ info.FFMpegFilename = "ffmpeg.exe";
+ info.FFProbeFilename = "ffprobe.exe";
+ info.Version = "20160401";
+ info.ArchiveType = "7z";
+ info.IsEmbedded = true;
+ info.DownloadUrls = GetDownloadUrls();
+
+ return info;
+ }
+
+ private string[] GetDownloadUrls()
+ {
+ switch (Environment.SystemArchitecture)
+ {
+ case Architecture.X86_X64:
+ return new[] { "MediaBrowser.ServerApplication.ffmpeg.ffmpegx64.7z" };
+ case Architecture.X86:
+ return new[] { "MediaBrowser.ServerApplication.ffmpeg.ffmpegx86.7z" };
+ }
+
+ return new string[] { };
+ }
}
}