@@ -76,15 +76,17 @@ public void setProducts (String products) {
7676 @ Override
7777 public FilePath performInstallation (ToolInstallation tool , Node node , TaskListener log )
7878 throws IOException , InterruptedException {
79- FilePath expectedPath = preferredLocation (tool , node );
79+ FilePath supportingExecutable = preferredLocation (tool , node );
80+ FilePath expectedPath = new FilePath (supportingExecutable , this .getVersion ());
8081 MatlabInstallable installable ;
8182 try {
8283 installable = (MatlabInstallable ) getInstallable (node );
8384 } catch (Exception e ) {
8485 throw new InstallationFailedException (e .getMessage ());
8586 }
8687
87- getFreshCopyOfExecutables (installable , expectedPath );
88+ getFreshCopyOfExecutables (installable , supportingExecutable );
89+ makeDir (expectedPath );
8890
8991 FilePath versionInfo = new FilePath (expectedPath ,"VersionInfo.xml" );
9092 FilePath installedProducts = new FilePath (expectedPath ,"installed_matlab_product_list.txt" );
@@ -109,7 +111,7 @@ private int installUsingMpm (Node node, FilePath destination, TaskListener log,
109111 ProcStarter installerProc = matlabInstaller .launch ();
110112
111113 ArgumentListBuilder args = new ArgumentListBuilder ();
112- args .add (destination .getRemote () + getNodeSpecificMPMExecutor (node ));
114+ args .add (destination .getParent (). getRemote () + getNodeSpecificMPMExecutor (node ));
113115 args .add ("install" );
114116 appendReleaseToArguments (args , log );
115117 args .add ("--destination=" + destination .getRemote ());
@@ -119,12 +121,19 @@ private int installUsingMpm (Node node, FilePath destination, TaskListener log,
119121 try {
120122 result = installerProc .join ();
121123 } catch (Exception e ) {
122- log .getLogger ().println ("MATLAB installation failed" + e .getMessage ());
124+ log .getLogger ().println ("MATLAB installation failed " + e .getMessage ());
123125 throw new InstallationFailedException (e .getMessage ());
124126 }
125127 return result ;
126128 }
127129
130+ private void makeDir (FilePath path ) throws IOException , InterruptedException {
131+ if (!path .exists ()){
132+ path .mkdirs ();
133+ path .chmod (0777 );
134+ }
135+ }
136+
128137 private boolean isSameProduct (FilePath installedProducts )
129138 throws IOException , InterruptedException {
130139 if (installedProducts .exists ()) {
@@ -250,6 +259,9 @@ public Installable getInstallable (Node node) throws IOException, InterruptedExc
250259 // Gather properties for the node to install on
251260 String [] properties = node .getChannel ()
252261 .call (new GetSystemProperties ("os.name" , "os.arch" , "os.version" ));
262+ if (properties [0 ].contains ("win" )) {
263+ throw new InstallationFailedException ("Unsupported OS" );
264+ }
253265 return getInstallCandidate (properties [0 ], properties [1 ]);
254266 }
255267
0 commit comments