Subject: | Include Windows 10 in OS.pm |
Date: | Wed, 27 Apr 2016 02:02:29 +0000 |
To: | "bug-Sys-Info-Driver-Windows [...] rt.cpan.org" <bug-Sys-Info-Driver-Windows [...] rt.cpan.org> |
From: | Tim Boughen <Tim.Boughen [...] tollgroup.com> |
$os->name(long=> 1) returns "Windows NT 2.10.0 build 10240"
My script
my $info = Sys::Info->new;
my $cpu = $info->device('CPU');
my $computer = sprintf "%s (%s bit)", scalar $cpu->identify, $cpu->bitness;
my $os = $info->os;
my ($bitReturn);
if ( $os->bitness ) {
$bitReturn = $os->bitness;
} else {
$bitReturn = &bitter();
}
my $winver = sprintf "%s (%s bit)", $os->name(long => 1), $bitReturn;
sub bitter {
my $Register = "Software\\Wow6432Node";
my ($hkey,$bitReturn);
if ($HKEY_LOCAL_MACHINE->Open($Register,$hkey)) {
$bitReturn = "64";
}
else {
$bitReturn = "32"
}
return $bitReturn;
}
print "$winver\n";