diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-01-12 22:46:44 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-01-12 22:46:44 -0500 |
| commit | d8d5dd487326dd3fccf4e9f30cd8f7e3783fcfda (patch) | |
| tree | cf9950d32ee194d72a367c836a70dfb8f4e61401 /MediaBrowser.ServerApplication | |
| parent | f55217406985ad21da44aa523353f33e3f720ccd (diff) | |
make channel access opt-in rather than opt out
Diffstat (limited to 'MediaBrowser.ServerApplication')
| -rw-r--r-- | MediaBrowser.ServerApplication/MainStartup.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.ServerApplication/Native/Autorun.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.ServerApplication/Native/WindowsApp.cs | 12 |
3 files changed, 16 insertions, 6 deletions
diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index adc8eecb1..7532a2edd 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -203,7 +203,7 @@ namespace MediaBrowser.ServerApplication { var fileSystem = new NativeFileSystem(logManager.GetLogger("FileSystem"), false); - var nativeApp = new WindowsApp + var nativeApp = new WindowsApp(fileSystem) { IsRunningAsService = runService }; diff --git a/MediaBrowser.ServerApplication/Native/Autorun.cs b/MediaBrowser.ServerApplication/Native/Autorun.cs index 0262f711e..593bb7955 100644 --- a/MediaBrowser.ServerApplication/Native/Autorun.cs +++ b/MediaBrowser.ServerApplication/Native/Autorun.cs @@ -1,4 +1,5 @@ -using System; +using MediaBrowser.Common.IO; +using System; using System.IO; namespace MediaBrowser.ServerApplication.Native @@ -12,7 +13,8 @@ namespace MediaBrowser.ServerApplication.Native /// Configures the specified autorun. /// </summary> /// <param name="autorun">if set to <c>true</c> [autorun].</param> - public static void Configure(bool autorun) + /// <param name="fileSystem">The file system.</param> + public static void Configure(bool autorun, IFileSystem fileSystem) { var shortcutPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Media Browser 3", "Media Browser Server.lnk"); @@ -26,7 +28,7 @@ namespace MediaBrowser.ServerApplication.Native else { //Remove our shortcut from the startup folder for this user - File.Delete(Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "MBstartup.lnk")); + fileSystem.DeleteFile(Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "MBstartup.lnk")); } } } diff --git a/MediaBrowser.ServerApplication/Native/WindowsApp.cs b/MediaBrowser.ServerApplication/Native/WindowsApp.cs index 45070e6ec..476fb58b9 100644 --- a/MediaBrowser.ServerApplication/Native/WindowsApp.cs +++ b/MediaBrowser.ServerApplication/Native/WindowsApp.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Common.Net; +using MediaBrowser.Common.IO; +using MediaBrowser.Common.Net; using MediaBrowser.IsoMounter; using MediaBrowser.Model.Logging; using MediaBrowser.Server.Startup.Common; @@ -10,6 +11,13 @@ namespace MediaBrowser.ServerApplication.Native { public class WindowsApp : INativeApp { + private readonly IFileSystem _fileSystem; + + public WindowsApp(IFileSystem fileSystem) + { + _fileSystem = fileSystem; + } + public List<Assembly> GetAssembliesWithParts() { var list = new List<Assembly>(); @@ -89,7 +97,7 @@ namespace MediaBrowser.ServerApplication.Native public void ConfigureAutoRun(bool autorun) { - Autorun.Configure(autorun); + Autorun.Configure(autorun, _fileSystem); } public INetworkManager CreateNetworkManager(ILogger logger) |
