浏览代码

One more shot at #19

Eric Reed 12 年之前
父节点
当前提交
f3b367628a
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      MediaBrowser.Common.Implementations/BaseApplicationHost.cs

+ 2 - 2
MediaBrowser.Common.Implementations/BaseApplicationHost.cs

@@ -500,14 +500,14 @@ namespace MediaBrowser.Common.Implementations
             if (ConfigurationManager.CommonConfiguration.RunAtStartup)
             {
                 //Copy our shortut into the startup folder for this user
-                File.Copy(ProductShortcutPath, Environment.GetFolderPath(Environment.SpecialFolder.Startup), true);
+                File.Copy(ProductShortcutPath, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup),Path.GetFileName(ProductShortcutPath) ?? "MBstartup.lnk"), true);
             }
             else
             {
                 //Remove our shortcut from the startup folder for this user
                 try
                 {
-                    File.Delete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), Path.GetFileName(ProductShortcutPath)));
+                    File.Delete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), Path.GetFileName(ProductShortcutPath) ?? "MBstartup.lnk"));
                 }
                 catch (FileNotFoundException)
                 {