aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.ServerApplication/Native/Autorun.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-05-26 16:06:31 -0400
committerLuke <luke.pulverenti@gmail.com>2015-05-26 16:06:31 -0400
commit8bd7055d1738f22e9f52cd80a79e7a4ac23d61ff (patch)
tree185830059da50b6c43f13ca528fe981c1266808f /MediaBrowser.ServerApplication/Native/Autorun.cs
parenta3d796cd54c809c7ec2783e5cab6c37b2950410d (diff)
parentb666c627c8def4d1236090372bd6795fec940979 (diff)
Merge pull request #1109 from MediaBrowser/dev
3.0.5621.3
Diffstat (limited to 'MediaBrowser.ServerApplication/Native/Autorun.cs')
-rw-r--r--MediaBrowser.ServerApplication/Native/Autorun.cs19
1 files changed, 17 insertions, 2 deletions
diff --git a/MediaBrowser.ServerApplication/Native/Autorun.cs b/MediaBrowser.ServerApplication/Native/Autorun.cs
index 593bb7955..dd2a77565 100644
--- a/MediaBrowser.ServerApplication/Native/Autorun.cs
+++ b/MediaBrowser.ServerApplication/Native/Autorun.cs
@@ -18,17 +18,32 @@ namespace MediaBrowser.ServerApplication.Native
{
var shortcutPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Media Browser 3", "Media Browser Server.lnk");
+ if (!Directory.Exists(Path.GetDirectoryName(shortcutPath)))
+ {
+ shortcutPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Emby", "Emby Server.lnk");
+ }
+
var startupPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
+ // Remove lnk from old name
+ try
+ {
+ fileSystem.DeleteFile(Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "Media Browser Server.lnk"));
+ }
+ catch
+ {
+
+ }
+
if (autorun)
{
//Copy our shortut into the startup folder for this user
- File.Copy(shortcutPath, Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "MBstartup.lnk"), true);
+ File.Copy(shortcutPath, Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "Emby Server.lnk"), true);
}
else
{
//Remove our shortcut from the startup folder for this user
- fileSystem.DeleteFile(Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "MBstartup.lnk"));
+ fileSystem.DeleteFile(Path.Combine(startupPath, Path.GetFileName(shortcutPath) ?? "Emby Server.lnk"));
}
}
}