Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build.PL3
-rw-r--r--lib/Slic3r/GUI.pm14
2 files changed, 13 insertions, 4 deletions
diff --git a/Build.PL b/Build.PL
index 80007abaa..c376369b4 100644
--- a/Build.PL
+++ b/Build.PL
@@ -46,6 +46,9 @@ if ($gui) {
Wx::GLCanvas 0
OpenGL 0
);
+ if ($^O eq 'MSWin32') {
+ $recommends{Win32::TieRegistry} = 0;
+ }
} elsif ($xs_only) {
%prereqs = %recommends = ();
}
diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm
index bb32281dc..246c7edb7 100644
--- a/lib/Slic3r/GUI.pm
+++ b/lib/Slic3r/GUI.pm
@@ -300,10 +300,16 @@ sub scan_serial_ports {
my @ports = ();
- # TODO: Windows ports
-
- # UNIX and OS X
- push @ports, glob '/dev/{ttyUSB,ttyACM,tty.,cu.,rfcomm}*';
+ if ($^O eq 'MSWin32') {
+ # Windows
+ my %reg;
+ if (eval "use Win32::TieRegistry (TiedHash => \\%reg); 1") {
+ push @ports, sort values %{$reg{"HKEY_CURRENT_USER\\HARDWARE\\DEVICEMAP\\SERIALCOMM"}};
+ }
+ } else {
+ # UNIX and OS X
+ push @ports, glob '/dev/{ttyUSB,ttyACM,tty.,cu.,rfcomm}*';
+ }
return @ports;
}