Skip to content

Commit 663a901

Browse files
committed
Refactor Windows 10 support to include ProductInfo settings
Also add some tests for 8.1, 10, 2012 R2
1 parent b259ccb commit 663a901

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Win32.pm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,13 @@ sub _GetOSName {
477477
$desc = "R2";
478478
}
479479
}
480+
}
481+
elsif ($major == 10) {
482+
$os = '10';
483+
}
480484

481-
if ($productinfo == PRODUCT_ULTIMATE) {
485+
if ($major >= 6) {
486+
if ($productinfo == PRODUCT_ULTIMATE) {
482487
$desc .= " Ultimate";
483488
}
484489
elsif ($productinfo == PRODUCT_HOME_PREMIUM) {
@@ -541,11 +546,6 @@ sub _GetOSName {
541546
$desc .= " (64-bit)";
542547
}
543548
}
544-
elsif ($major == 10) {
545-
if ($minor == 0) {
546-
$os = '10';
547-
}
548-
}
549549
}
550550

551551
unless (defined $os) {

t/GetOSName.t

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ my @dual_tests = (
104104
["2012", "2012", 2, 6, 2, 0x00, 2, 89 ],
105105
["[Small Business Server] 2008 R2", "2008", 2, 6, 1, 0x09, 2, 89 ],
106106

107+
["8.1", "8.1", 2, 6, 3 ],
108+
["2012 [R2]", "2012", 2, 6, 3, 0x00, 2, 89 ],
109+
110+
["10", "10", 2, 10, 0 ],
111+
107112
);
108113

109114
my @ia64_tests = (

0 commit comments

Comments
 (0)