http://www.perlmonks.org?node_id=1007183


in reply to access 64bit registry from 32 bit Perl

I use the following sub to grovel through registry looking for installers which may be of interest to you:

sub FindXXXSoftware { my ($resetNoModify) = @_; return if !$^O eq 'MSWin32'; my @result; eval { require 'Win32/API.pm'; require 'Win32/TieRegistry.pm'; require 'Win32API/Registry.pm'; my $pathPrefix = 'LMachine\SOFTWARE'; my $wowPath = 'Wow6432Node'; my $pathSuffix = 'Microsoft\Windows\CurrentVersion\Uninstall'; my $root = Win32::TieRegistry->new($pathPrefix, {Access => Win32API::Registry::KEY_READ()}); my @products; for my $subPath ($pathSuffix, "$wowPath\\$pathSuffix") { my $uninstall = $root->Open($subPath); next if !$uninstall; $uninstall->Flush(); my @entries = $uninstall->SubKeyNames(); for my $entry (@entries) { my $entryKey = $uninstall->Open($entry); my $name = $entryKey->GetValue('DisplayName'); my $pub = $entryKey->GetValue('Publisher'); my $noModify = $entryKey->GetValue('NoModify'); next if !defined $name || !defined $pub || $pub !~ /^XXX/i; eval { delete $entryKey->{NoModify}; return 1; } or warn "Registry DeleteValue failed for 'NoModify' agains +t $name\n" if defined $noModify && $resetNoModify; push @result, {entryCode => $entry, name => $name}; } } return 1; }; return @result; }
True laziness is hard work