Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
This commit is contained in:
commit
fb9387fa35
|
@ -472,11 +472,33 @@ namespace MediaBrowser.Common.Implementations
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the full path to our shortcut in the start menu
|
||||||
|
/// </summary>
|
||||||
|
protected abstract string ProductShortcutPath { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Configures the auto run at startup.
|
/// Configures the auto run at startup.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void ConfigureAutoRunAtStartup()
|
private void ConfigureAutoRunAtStartup()
|
||||||
{
|
{
|
||||||
|
if (ConfigurationManager.CommonConfiguration.RunAtStartup)
|
||||||
|
{
|
||||||
|
//Copy our shortut into the startup folder for this user
|
||||||
|
File.Copy(ProductShortcutPath, Environment.GetFolderPath(Environment.SpecialFolder.Startup), 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)));
|
||||||
|
}
|
||||||
|
catch (FileNotFoundException)
|
||||||
|
{
|
||||||
|
//This is okay - trying to remove it anyway
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -128,6 +128,14 @@ namespace MediaBrowser.ServerApplication
|
||||||
/// <value>The HTTP server.</value>
|
/// <value>The HTTP server.</value>
|
||||||
private IHttpServer HttpServer { get; set; }
|
private IHttpServer HttpServer { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The full path to our startmenu shortcut
|
||||||
|
/// </summary>
|
||||||
|
protected override string ProductShortcutPath
|
||||||
|
{
|
||||||
|
get { return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Media Browser Server.lnk"); }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Runs the startup tasks.
|
/// Runs the startup tasks.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user