// install it as a service
logger.println(Messages.ManagedWindowsServiceLauncher_RegisteringService());
Document dom = new SAXReader().read(new StringReader(xml));
Win32Service svc = services.Get("Win32_Service").cast(Win32Service.class);
int r = svc.Create(
id,
dom.selectSingleNode("/service/name").getText()+" at "+path,
path+"\\hudson-slave.exe",
Win32OwnProcess, 0, "Manual", true);
if(r!=0) {