I need to get unique hardware identifier, so I read MachineGuid from windows registry.
I have virtualbox machine with strawberry perl on Windows 7, and pc with Windows 7 too but without perl interpreter. This code works in virtualbox, but when I pack it to exe with PerlApp and try to execute on real machine it can`t get guid value.
use Win32::TieRegistry qw(:KEY_);
use warnings;
$Registry = $Registry->Open('', {Access => KEY_READ(), Delimiter => "/"});
my $guid = $Registry->{'HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Cryptography//MachineGuid'};
if ($guid) {
print "guid = $guid\n";
} else {
print "failed to get MachineGuid!\n";
}