The Free Software Media System - Server Backend & API
MBTheater shutdown code in installer/uninstaller
Eric Reedd3e6dd553502
diff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.csindex f3f3c77402..58d1d11ac4 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");+ }+ }++ }+ }// Downloadvar archive = await DownloadPackage(version);diff --git a/MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs b/MediaBrowser.Uninstaller.Execute/MainWindow.xaml.csindex 9906af2731..28eded0b94 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 tooif (Directory.GetFiles(startMenu).Length == 0){