diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-26 11:11:05 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-26 11:11:05 -0500 |
| commit | cbb2f00da5a6a45610c517392dae7067a620dba2 (patch) | |
| tree | 562768e8cc47c887b26c454fc2c196a751830817 /MediaBrowser.Installer/MainWindow.xaml.cs | |
| parent | 6efd22a3d22f8d87ad17da3a1e47ca26c5bb09f2 (diff) | |
| parent | c76c74fb24c471218a43cb3538080f3c86dabfba (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Installer/MainWindow.xaml.cs')
| -rw-r--r-- | MediaBrowser.Installer/MainWindow.xaml.cs | 28 |
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(); } |
