diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-04-03 18:15:23 -0400 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2016-04-03 18:15:23 -0400 |
| commit | e343db46c5a053f1ad02f96f38a40d2d64581aa3 (patch) | |
| tree | e25114e343a0f3e287722ec00a0bae32e776b846 /MediaBrowser.ServerApplication/Native/WindowsApp.cs | |
| parent | c2d84fc26da028ade684fdd7b924744d9c5fedfb (diff) | |
| parent | 4afc2c9156a266a980d06b6657a74f0f4ad47a65 (diff) | |
Merge pull request #1624 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.ServerApplication/Native/WindowsApp.cs')
| -rw-r--r-- | MediaBrowser.ServerApplication/Native/WindowsApp.cs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/MediaBrowser.ServerApplication/Native/WindowsApp.cs b/MediaBrowser.ServerApplication/Native/WindowsApp.cs index 056258f962..146a4372b9 100644 --- a/MediaBrowser.ServerApplication/Native/WindowsApp.cs +++ b/MediaBrowser.ServerApplication/Native/WindowsApp.cs @@ -3,6 +3,7 @@ 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; @@ -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) |
