aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Installer/MainWindow.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Installer/MainWindow.xaml.cs')
-rw-r--r--MediaBrowser.Installer/MainWindow.xaml.cs28
1 files changed, 15 insertions, 13 deletions
diff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.cs
index 01e15dfd8..f71173691 100644
--- a/MediaBrowser.Installer/MainWindow.xaml.cs
+++ b/MediaBrowser.Installer/MainWindow.xaml.cs
@@ -10,7 +10,6 @@ using System.Linq;
using Ionic.Zip;
using MediaBrowser.Installer.Code;
using ServiceStack.Text;
-using IWshRuntimeLibrary;
namespace MediaBrowser.Installer
{
@@ -124,7 +123,7 @@ namespace MediaBrowser.Installer
var fullPath = Path.Combine(RootPath, "System", TargetExe);
try
{
- CreateShortcut(fullPath);
+ CreateShortcuts(fullPath);
}
catch (Exception e)
{
@@ -155,7 +154,7 @@ namespace MediaBrowser.Installer
var json = await client.DownloadStringTaskAsync("http://www.mb3admin.com/admin/service/package/retrieveAll?name=" + PackageName);
var packages = JsonSerializer.DeserializeFromString<List<PackageInfo>>(json);
- var version = packages[0].versions.Where(v => v.classification == PackageClass).OrderByDescending(v => v.version).FirstOrDefault(v => v.version <= PackageVersion);
+ var version = packages[0].versions.Where(v => v.classification <= PackageClass).OrderByDescending(v => v.version).FirstOrDefault(v => v.version <= PackageVersion);
if (version == null)
{
SystemClose("Could not locate download package. Aborting.");
@@ -225,21 +224,24 @@ namespace MediaBrowser.Installer
/// Only do current user to avoid need for admin elevation
/// </summary>
/// <param name="targetExe"></param>
- protected void CreateShortcut(string targetExe)
+ protected void CreateShortcuts(string targetExe)
{
// get path to all users start menu
- var shell = new WshShell();
- var startMenu = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu),"Media Browser");
+ var startMenu = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu),"Media Browser 3");
if (!Directory.Exists(startMenu)) Directory.CreateDirectory(startMenu);
- var product = (IWshShortcut)shell.CreateShortcut(Path.Combine(startMenu, FriendlyName+".lnk"));
- product.TargetPath = targetExe;
- product.Description = "Run " + FriendlyName;
+ var product = new ShellShortcut(Path.Combine(startMenu, FriendlyName+".lnk")) {Path = targetExe, Description = "Run " + FriendlyName};
product.Save();
- var uninstall = (IWshShortcut)shell.CreateShortcut(Path.Combine(startMenu, "Uninstall " + FriendlyName + ".lnk"));
- uninstall.TargetPath = Path.Combine(Path.GetDirectoryName(targetExe),"MediaBrowser.Uninstaller.exe");
- uninstall.Arguments = (PackageName == "MBServer" ? "server" : "mbt");
- uninstall.Description = "Uninstall " + FriendlyName;
+ if (PackageName == "MBServer")
+ {
+ var path = Path.Combine(startMenu, "MB Dashboard.lnk");
+ var dashboard = new ShellShortcut(path)
+ {Path = @"http://localhost:8096/mediabrowser/dashboard/dashboard.html", Description = "Open the Media Browser Server Dashboard (configuration)"};
+ dashboard.Save();
+
+ }
+ var uninstall = new ShellShortcut(Path.Combine(startMenu, "Uninstall " + FriendlyName + ".lnk"))
+ {Path = Path.Combine(Path.GetDirectoryName(targetExe), "MediaBrowser.Uninstaller.exe"), Arguments = (PackageName == "MBServer" ? "server" : "mbt"), Description = "Uninstall " + FriendlyName};
uninstall.Save();
}