mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
Implement configureautorun in server #19 need to update nuget to put in mbt
This commit is contained in:
@@ -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>
|
||||
/// Configures the auto run at startup.
|
||||
/// </summary>
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user