scheduler installer fix
This commit is contained in:
parent
53aff75c14
commit
75ccdbb916
3 changed files with 121 additions and 36 deletions
|
@ -1110,6 +1110,25 @@ namespace WebsitePanel.Setup
|
|||
wmiService.Delete();
|
||||
}
|
||||
|
||||
public static string GetServicePath(string serviceName)
|
||||
{
|
||||
var mc = new ManagementClass("Win32_Service");
|
||||
|
||||
foreach (var mo in mc.GetInstances())
|
||||
{
|
||||
if (mo.GetPropertyValue("Name").ToString() == serviceName)
|
||||
{
|
||||
var path = mo.GetPropertyValue("PathName").ToString().Trim('"');
|
||||
|
||||
var directory = Path.GetDirectoryName(path);
|
||||
|
||||
return directory;
|
||||
}
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue