diff options
| author | Eric Reed <ebr@mediabrowser3.com> | 2013-02-28 12:12:38 -0500 |
|---|---|---|
| committer | Eric Reed <ebr@mediabrowser3.com> | 2013-02-28 12:12:38 -0500 |
| commit | d3e6dd55350293673e8e494b3d7c4bcd6c79768d (patch) | |
| tree | fa1398ae98bc8d601f1c6e1ba03f3600b7175d92 | |
| parent | cc574074b9375390e3a7252ea97abe89f387861f (diff) | |
MBTheater shutdown code in installer/uninstaller
| -rw-r--r-- | MediaBrowser.Installer/MainWindow.xaml.cs | 20 | ||||
| -rw-r--r-- | MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs | 16 |
2 files changed, 36 insertions, 0 deletions
diff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.cs index f3f3c7740..58d1d11ac 100644 --- a/MediaBrowser.Installer/MainWindow.xaml.cs +++ b/MediaBrowser.Installer/MainWindow.xaml.cs @@ -131,6 +131,26 @@ namespace MediaBrowser.Installer } } } + else + { + if (PackageName == "MBTheater") + { + // Uninstalling MBT - shut it down if it is running + var processes = Process.GetProcessesByName("mediabrowser.ui"); + if (processes.Length > 0) + { + try + { + processes[0].CloseMainWindow(); + } + catch (Exception ex) + { + MessageBox.Show("Unable to shutdown Media Browser Theater. Please ensure it is not running before hitting OK.\n\n" + ex.Message, "Error"); + } + } + + } + } // Download var archive = await DownloadPackage(version); diff --git a/MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs b/MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs index 9906af273..28eded0b9 100644 --- a/MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs +++ b/MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs @@ -98,6 +98,22 @@ namespace MediaBrowser.Uninstaller.Execute } } } + else + { + // Installing MBT - shut it down if it is running + var processes = Process.GetProcessesByName("mediabrowser.ui"); + if (processes.Length > 0) + { + try + { + processes[0].CloseMainWindow(); + } + catch (Exception ex) + { + MessageBox.Show("Unable to shutdown Media Browser Theater. Please ensure it is not running before hitting OK.\n\n" + ex.Message, "Error"); + } + } + } // if the startmenu item is empty now - delete it too if (Directory.GetFiles(startMenu).Length == 0) { |
