Skip to content

Commit

Permalink
add more verbose logging aroudn killing supporting processes when sto…
Browse files Browse the repository at this point in the history
…pping to help issue #29

version up
  • Loading branch information
cjmurph committed May 7, 2018
1 parent 124710f commit 99c3d09
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions PlexService/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.6.0")]
[assembly: AssemblyFileVersion("1.1.6.0")]
[assembly: AssemblyVersion("1.1.7.0")]
[assembly: AssemblyFileVersion("1.1.7.0")]
4 changes: 2 additions & 2 deletions PlexServiceCommon/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.6.0")]
[assembly: AssemblyFileVersion("1.1.6.0")]
[assembly: AssemblyVersion("1.1.7.0")]
[assembly: AssemblyFileVersion("1.1.7.0")]
4 changes: 2 additions & 2 deletions PlexServiceInstaller/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="*" Name="Plex Service" Language="1033" Version="1.1.6" Manufacturer="cjmurph" UpgradeCode="daa483bb-c7e1-4c79-a4d6-3c2c4c3d9daf">
<Product Id="*" Name="Plex Service" Language="1033" Version="1.1.7" Manufacturer="cjmurph" UpgradeCode="daa483bb-c7e1-4c79-a4d6-3c2c4c3d9daf">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" SummaryCodepage="1252" />
<Binary Id="success_bmp" SourceFile="$(sys.SOURCEFILEDIR)success.bmp" />
<Binary Id="error_bmp" SourceFile="$(sys.SOURCEFILEDIR)error.bmp" />
Expand All @@ -21,7 +21,7 @@
<Condition Message="This application requires .NET Framework 4.0 to run. Please install the .NET Framework then run this installer again.">
<![CDATA[Installed OR NETFRAMEWORK40FULL]]>
</Condition>
<Feature Id="PlexServiceFeature" Title="Plex Service" Description="Plex Service 1.1.6" Level="1" ConfigurableDirectory='INSTALLDIR'>
<Feature Id="PlexServiceFeature" Title="Plex Service" Description="Plex Service 1.1.7" Level="1" ConfigurableDirectory='INSTALLDIR'>
<ComponentRef Id="PlexServiceComponent" />
<ComponentRef Id="PlexServiceWCFComponent" />
<ComponentRef Id="PlexServiceCommonComponent" />
Expand Down
4 changes: 2 additions & 2 deletions PlexServiceTray/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.6.0")]
[assembly: AssemblyFileVersion("1.1.6.0")]
[assembly: AssemblyVersion("1.1.7.0")]
[assembly: AssemblyFileVersion("1.1.7.0")]
8 changes: 7 additions & 1 deletion PlexServiceWCF/PmsMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ private void EndPlex()
/// <param name="names">The names of the processes to kill</param>
private void KillSupportingProcesses()
{
OnPlexStatusChange(this, new StatusChangeEventArgs("Killing supporting processes."));
foreach (string name in _supportingProcesses)
{
KillSupportingProcess(name);
Expand All @@ -402,24 +403,29 @@ private void KillSupportingProcesses()
private void KillSupportingProcess(string name)
{
//see if its running
OnPlexStatusChange(this, new StatusChangeEventArgs("Looking for " + name));
Process[] supportProcesses = Process.GetProcessesByName(name);
OnPlexStatusChange(this, new StatusChangeEventArgs(supportProcesses.Length + " instances of " + name + " found"));
if (supportProcesses.Length > 0)
{
foreach (Process supportProcess in supportProcesses)
{
OnPlexStatusChange(this, new StatusChangeEventArgs("Stopping " + name + " with PID " + supportProcess.Id));
try
{
supportProcess.Kill();
OnPlexStatusChange(this, new StatusChangeEventArgs(name + " with PID stopped"));
}
catch
{
OnPlexStatusChange(this, new StatusChangeEventArgs("Unable to stop process " + supportProcess.Id));
}
finally
{
supportProcess.Dispose();
}
}
OnPlexStatusChange(this, new StatusChangeEventArgs(string.Format("{0} Stopped.", name)));
//OnPlexStatusChange(this, new StatusChangeEventArgs(string.Format("{0} Stopped.", name)));
}
}

Expand Down
4 changes: 2 additions & 2 deletions PlexServiceWCF/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.6.0")]
[assembly: AssemblyFileVersion("1.1.6.0")]
[assembly: AssemblyVersion("1.1.7.0")]
[assembly: AssemblyFileVersion("1.1.7.0")]

0 comments on commit 99c3d09

Please sign in to comment.