diff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.cs
index f711736910..f48c30f851 100644
--- a/MediaBrowser.Installer/MainWindow.xaml.cs
+++ b/MediaBrowser.Installer/MainWindow.xaml.cs
@@ -103,6 +103,27 @@ 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
+ 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);
+ }
+ }
+ });
+ }
+
// Download
var archive = await DownloadPackage(version);
dlAnimation.StopAnimation();
diff --git a/MediaBrowser.Installer/MediaBrowser.Installer.csproj b/MediaBrowser.Installer/MediaBrowser.Installer.csproj
index 1b40618f75..36769fdb28 100644
--- a/MediaBrowser.Installer/MediaBrowser.Installer.csproj
+++ b/MediaBrowser.Installer/MediaBrowser.Installer.csproj
@@ -29,7 +29,7 @@
Media Browser Team
Media Browser
false
- 17
+ 21
0.1.1.%2a
false
true