aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Installer/MainWindow.xaml.cs20
-rw-r--r--MediaBrowser.Uninstaller.Execute/MainWindow.xaml.cs16
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)
{