diff --git a/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java b/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java index 6a8b4bec8d44d9624c1ee30fc6995bf12c5e7f12..87e00266a5f4783a6057494dfe72a1e3896891cf 100644 --- a/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java +++ b/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java @@ -123,7 +123,10 @@ public class WindowsServiceLifecycle extends Lifecycle { ByteArrayOutputStream baos = new ByteArrayOutputStream(); StreamTaskListener task = new StreamTaskListener(baos); task.getLogger().println("Restarting a service"); - File executable = new File(home, "hudson.exe"); + String exe = System.getenv("WINSW_EXECUTABLE"); + File executable; + if (exe!=null) executable = new File(exe); + else executable = new File(home, "hudson.exe"); if (!executable.exists()) executable = new File(home, "jenkins.exe"); int r = new LocalLauncher(task).launch().cmds(executable, "restart")