[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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user