|
|
|
@ -214,8 +214,6 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
|
SystemEvents.SessionEnding += SystemEvents_SessionEnding;
|
|
|
|
|
SystemEvents.SessionSwitch += SystemEvents_SessionSwitch;
|
|
|
|
|
|
|
|
|
|
MigrateShortcuts(appPaths.RootFolderPath);
|
|
|
|
|
|
|
|
|
|
_appHost = new ApplicationHost(appPaths, logManager);
|
|
|
|
|
|
|
|
|
|
_app = new App(_appHost, _appHost.LogManager.GetLogger("App"), runService);
|
|
|
|
@ -537,34 +535,5 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
|
/// </summary>
|
|
|
|
|
SEM_NOOPENFILEERRORBOX = 0x8000
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void MigrateShortcuts(string directory)
|
|
|
|
|
{
|
|
|
|
|
Directory.CreateDirectory(directory);
|
|
|
|
|
|
|
|
|
|
foreach (var file in Directory.EnumerateFiles(directory, "*.lnk", SearchOption.AllDirectories).ToList())
|
|
|
|
|
{
|
|
|
|
|
MigrateShortcut(file);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void MigrateShortcut(string file)
|
|
|
|
|
{
|
|
|
|
|
var newFile = Path.ChangeExtension(file, ".mblink");
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var resolvedPath = FileSystem.ResolveShortcut(file);
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(resolvedPath))
|
|
|
|
|
{
|
|
|
|
|
FileSystem.CreateShortcut(newFile, resolvedPath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
File.Delete(file);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|