commit
e343db46c5
|
@ -111,7 +111,8 @@ namespace MediaBrowser.Common.Implementations.Updates
|
||||||
targetFilename = targetFilename,
|
targetFilename = targetFilename,
|
||||||
versionStr = version.ToString(),
|
versionStr = version.ToString(),
|
||||||
requiredVersionStr = "1.0.0",
|
requiredVersionStr = "1.0.0",
|
||||||
description = obj.body
|
description = obj.body,
|
||||||
|
infoUrl = obj.html_url
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,5 +87,7 @@ namespace MediaBrowser.Model.Updates
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The target filename.</value>
|
/// <value>The target filename.</value>
|
||||||
public string targetFilename { get; set; }
|
public string targetFilename { get; set; }
|
||||||
|
|
||||||
|
public string infoUrl { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -116,7 +116,8 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
|
||||||
|
|
||||||
var notification = new NotificationRequest
|
var notification = new NotificationRequest
|
||||||
{
|
{
|
||||||
NotificationType = type
|
NotificationType = type,
|
||||||
|
Url = e.Argument.infoUrl
|
||||||
};
|
};
|
||||||
|
|
||||||
notification.Variables["Version"] = e.Argument.versionStr;
|
notification.Variables["Version"] = e.Argument.versionStr;
|
||||||
|
|
|
@ -110,7 +110,6 @@
|
||||||
<DependentUpon>MainForm.cs</DependentUpon>
|
<DependentUpon>MainForm.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="MainStartup.cs" />
|
<Compile Include="MainStartup.cs" />
|
||||||
<Compile Include="Native\Autorun.cs" />
|
|
||||||
<Compile Include="Native\Standby.cs" />
|
<Compile Include="Native\Standby.cs" />
|
||||||
<Compile Include="Native\ServerAuthorization.cs" />
|
<Compile Include="Native\ServerAuthorization.cs" />
|
||||||
<Compile Include="Native\WindowsApp.cs" />
|
<Compile Include="Native\WindowsApp.cs" />
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using CommonIO;
|
|
||||||
|
|
||||||
namespace MediaBrowser.ServerApplication.Native
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Class Autorun
|
|
||||||
/// </summary>
|
|
||||||
public static class Autorun
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Configures the specified autorun.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="autorun">if set to <c>true</c> [autorun].</param>
|
|
||||||
/// <param name="fileSystem">The file system.</param>
|
|
||||||
public static void Configure(bool autorun, IFileSystem fileSystem)
|
|
||||||
{
|
|
||||||
var shortcutPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Emby", "Emby Server.lnk");
|
|
||||||
|
|
||||||
var startupPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup);
|
|
||||||
|
|
||||||
if (autorun)
|
|
||||||
{
|
|
||||||
//Copy our shortut into the startup folder for this user
|
|
||||||
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) ?? "Emby Server.lnk"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,6 +3,7 @@ using MediaBrowser.Model.Logging;
|
||||||
using MediaBrowser.Server.Startup.Common;
|
using MediaBrowser.Server.Startup.Common;
|
||||||
using MediaBrowser.ServerApplication.Networking;
|
using MediaBrowser.ServerApplication.Networking;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
using MediaBrowser.Controller.Power;
|
using MediaBrowser.Controller.Power;
|
||||||
|
@ -108,7 +109,22 @@ namespace MediaBrowser.ServerApplication.Native
|
||||||
|
|
||||||
public void ConfigureAutoRun(bool autorun)
|
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)
|
public INetworkManager CreateNetworkManager(ILogger logger)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user