scheduler installer fix

This commit is contained in:
a.skorina 2014-12-18 17:50:06 +03:00
parent 53aff75c14
commit 75ccdbb916
3 changed files with 121 additions and 36 deletions

View file

@ -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
}