From 645cc65d2b340752f390359ce3ed09a49b463588 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Tue, 26 Jun 2018 15:29:23 +0200 Subject: [PATCH] When running on Windows, Perl $^X returns slic3r.exe or slic3r-console.exe Do some magic to get the perl interpreter path. --- lib/Slic3r/Print.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 8300fdbed..a9763a824 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -101,7 +101,12 @@ sub export_gcode { die "The configured post-processing script is not executable: check permissions. ($script)\n"; } if ($^O eq 'MSWin32' && $script =~ /\.[pP][lL]/) { - system($^X, $script, $output_file); + # The current process (^X) may be slic3r.exe or slic3r-console.exe. + # Replace it with the current perl interpreter. + my($filename, $directories, $suffix) = fileparse($^X); + $filename =~ s/^slic3r.*$/perl5\.24\.0\.exe/; + my $interpreter = $directories . $filename; + system($interpreter, $script, $output_file); } else { system($script, $output_file); }