aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Reed <ebr@mediabrowser3.com>2013-02-28 11:43:00 -0500
committerEric Reed <ebr@mediabrowser3.com>2013-02-28 11:43:00 -0500
commit18f2ffd92cc98328a70f843be8d993bf6b2eb1ac (patch)
treed09916092a740663fbefdd59c5713240af91c7d9
parentbbb654c03000adda608c78bcb380369eec35225a (diff)
Don't async the server shutdown in installer
This way we can allow them to do it manually if it fails
-rw-r--r--MediaBrowser.Installer/MainWindow.xaml.cs31
1 files changed, 14 insertions, 17 deletions
diff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.cs
index fe672ec07..4268e5757 100644
--- a/MediaBrowser.Installer/MainWindow.xaml.cs
+++ b/MediaBrowser.Installer/MainWindow.xaml.cs
@@ -114,25 +114,22 @@ namespace MediaBrowser.Installer
var version = await GetPackageVersion();
lblStatus.Content = string.Format("Downloading {0} (version {1})...", FriendlyName, version.versionStr);
- // Now in the background - try and shut down the server if that is what we are installing
+ // Now try and shut down the server if that is what we are installing
if (PackageName == "MBServer")
{
- Task.Run(async () =>
- {
- using (var client = new WebClient())
- {
- try
- {
- await client.UploadStringTaskAsync("http://localhost:8096/mediabrowser/system/shutdown", "").ConfigureAwait(false);
- }
- catch (WebException e)
- {
- if (e.GetStatus() == HttpStatusCode.NotFound || e.Message.StartsWith("Unable to connect",StringComparison.OrdinalIgnoreCase)) return; // just wasn't running
-
- MessageBox.Show("Error shutting down server.\n\n" + e.GetStatus() + "\n\n" + e.Message);
- }
- }
- });
+ using (var client = new WebClient())
+ {
+ try
+ {
+ client.UploadString("http://localhost:8096/mediabrowser/System/Shutdown", "");
+ }
+ catch (WebException e)
+ {
+ if (e.GetStatus() == HttpStatusCode.NotFound || e.Message.StartsWith("Unable to connect",StringComparison.OrdinalIgnoreCase)) return; // just wasn't running
+
+ MessageBox.Show("Error shutting down server. Please be sure it is not running before hitting OK.\n\n" + e.GetStatus() + "\n\n" + e.Message);
+ }
+ }
}
// Download