aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukePulverenti <luke.pulverenti@gmail.com>2013-02-27 18:33:47 -0500
committerLukePulverenti <luke.pulverenti@gmail.com>2013-02-27 18:33:47 -0500
commit0cd583c300a209885f74cd2c120d314e5e113b56 (patch)
tree55dfded1133414a1ac8fbdcbb50822a75b5f9e02
parent8d32971354f2dd6a8e1a70066544aee8ff87f92f (diff)
parent187e1a4424a30c37a7156aa5068e1ec60cf75db9 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
-rw-r--r--MediaBrowser.Installer/MainWindow.xaml.cs21
-rw-r--r--MediaBrowser.Installer/MediaBrowser.Installer.csproj2
2 files changed, 22 insertions, 1 deletions
diff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.cs
index f71173691..f48c30f85 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 1b40618f7..36769fdb2 100644
--- a/MediaBrowser.Installer/MediaBrowser.Installer.csproj
+++ b/MediaBrowser.Installer/MediaBrowser.Installer.csproj
@@ -29,7 +29,7 @@
<PublisherName>Media Browser Team</PublisherName>
<SuiteName>Media Browser</SuiteName>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
- <ApplicationRevision>17</ApplicationRevision>
+ <ApplicationRevision>21</ApplicationRevision>
<ApplicationVersion>0.1.1.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>