[VMware Launcher 2.0.9.7]

- Enhancement: #4 Verify Windows services have properly terminated upon shutdown.
- Moved instanciation of ServiceControl class from Startup.xaml.cs to StatusWindow.xaml.cs.
This commit is contained in:
2021-04-13 12:04:14 +01:00
parent a9d7e48fac
commit f5b9c8f7a7
10 changed files with 72 additions and 9 deletions
+17
View File
@@ -1,6 +1,8 @@
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.ServiceProcess;
using System.Linq;
namespace VMwareLauncher
{
@@ -38,5 +40,20 @@ namespace VMwareLauncher
return errors;
}
public List<string> GetStoppedVmServices()
{
var stoppedVmServices = new List<string>();
var services = ServiceController.GetServices();
foreach (var service in services)
{
if (service.Status == ServiceControllerStatus.Stopped &&
VMwareServiceList.Contains(service.ServiceName))
stoppedVmServices.Add(service.ServiceName);
}
return stoppedVmServices;
}
}
}