Playing nice doesn't work - kill MBT

This commit is contained in:
Eric Reed 2013-02-28 12:27:49 -05:00
parent d3e6dd5535
commit a34c8c7cff
3 changed files with 8 additions and 5 deletions

View File

@ -112,11 +112,11 @@ namespace MediaBrowser.Installer
// Determine Package version
var version = await GetPackageVersion();
lblStatus.Content = string.Format("Downloading {0} (version {1})...", FriendlyName, version.versionStr);
// Now try and shut down the server if that is what we are installing and it is running
if (PackageName == "MBServer" && Process.GetProcessesByName("mediabrowser.serverapplication").Length != 0)
{
lblStatus.Content = "Shutting Down Media Browser Server...";
using (var client = new WebClient())
{
try
@ -139,9 +139,10 @@ namespace MediaBrowser.Installer
var processes = Process.GetProcessesByName("mediabrowser.ui");
if (processes.Length > 0)
{
lblStatus.Content = "Shutting Down Media Browser Theater...";
try
{
processes[0].CloseMainWindow();
processes[0].Kill();
}
catch (Exception ex)
{
@ -153,6 +154,7 @@ namespace MediaBrowser.Installer
}
// Download
lblStatus.Content = string.Format("Downloading {0} (version {1})...", FriendlyName, version.versionStr);
var archive = await DownloadPackage(version);
dlAnimation.StopAnimation();
prgProgress.Visibility = btnCancel.Visibility = Visibility.Hidden;

View File

@ -29,7 +29,7 @@
<PublisherName>Media Browser Team</PublisherName>
<SuiteName>Media Browser</SuiteName>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<ApplicationRevision>23</ApplicationRevision>
<ApplicationRevision>25</ApplicationRevision>
<ApplicationVersion>0.1.1.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -83,7 +83,7 @@ namespace MediaBrowser.Uninstaller.Execute
{
using (var client = new WebClient())
{
lblHeading.Content = "Shutting Down Server...";
lblHeading.Content = "Shutting Down Media Browser Server...";
try
{
client.UploadString("http://localhost:8096/mediabrowser/system/shutdown", "");
@ -104,9 +104,10 @@ namespace MediaBrowser.Uninstaller.Execute
var processes = Process.GetProcessesByName("mediabrowser.ui");
if (processes.Length > 0)
{
lblHeading.Content = "Shutting Down Media Browser Theater...";
try
{
processes[0].CloseMainWindow();
processes[0].Kill();
}
catch (Exception ex)
{