Skip to content
Permalink
Browse files

Use ID from node config for service name to support multi slaves and …

…create RootFs dir if not exist
  • Loading branch information...
Claus Schneider
Claus Schneider committed Aug 11, 2015
1 parent 3fbc843 commit a4d2121812fe9fe1b38bbe9d2cb57b9cd5435a0d
@@ -2,7 +2,6 @@

import com.sun.jna.Native;
import hudson.Launcher.LocalLauncher;
import hudson.lifecycle.Messages;
import hudson.model.TaskListener;
import hudson.util.StreamTaskListener;
import hudson.util.jna.DotNet;
@@ -83,7 +82,9 @@ public void install(LaunchConfiguration params, Prompter prompter) throws Instal

final File dir = params.getStorage().getAbsoluteFile();
if (!dir.exists())
throw new InstallationException(Messages.WindowsSlaveInstaller_RootFsDoesntExist(dir));
if (!dir.mkdirs()){
throw new InstallationException(Messages.WindowsSlaveInstaller_RootFsCreationFailed(dir));
}

final File slaveExe = new File(dir, "jenkins-slave.exe");
FileUtils.copyURLToFile(WindowsSlaveInstaller.class.getResource("jenkins-slave.exe"), slaveExe);
@@ -27,4 +27,4 @@ WindowsSlaveInstaller.ConfirmInstallation=\
When the installation is over, this slave agent will exit to let the new service take over.
WindowsSlaveInstaller.DotNetRequired=.NET Framework 2.0 or later is required for this feature
WindowsSlaveInstaller.InstallationSuccessful=Installation was successful. Would you like to start the service now?
WindowsSlaveInstaller.RootFsDoesntExist=Slave root directory ''{0}'' doesn''t exist
WindowsSlaveInstaller.RootFsCreationFailed=Slave root directory ''{0}'' cannot be created
@@ -30,7 +30,7 @@ THE SOFTWARE.
-->
<service>
<id>@ID@</id>
<name>Jenkins Slave</name>
<name>@ID@</name>
<description>This service runs a slave for Jenkins continuous integration system.</description>
<!--
if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.

0 comments on commit a4d2121

Please sign in to comment.
You can’t perform that action at this time.