note
Discipulus
ok [gepebril69] I have not a solution as your code produces useful results for me and for others too(more about it below). But I have some suggestions.<BR><BR>
Preamble: you said <i>special access flags to make it happen on 64bit platforms</i> and this ringed a bell in my mind: is this monk another victim of the evil [href://https://en.wikipedia.org/wiki/Folder_redirection|microsoft redirection]? you should already know, as you are using special access flags, but to fully understand read [id://1075559|this post from me].<BR><BR>
Filesystem redirection has two, equally evil, brothers: Registry redirection and COM object model. See what they say about [href://https://msdn.microsoft.com/it-it/library/windows/desktop/aa384232(v=vs.85).aspx|Registry redirection].<BR><BR>
Now that you know you are walking on <strike>mobile sands</strike> quicksand i can suggest to start with a little clean new code, instead of the code presented by you (even if it runs). In fact you are querying for unistallable programs and you know that your OS segregate 32bit from 64bit ones (with the funny WoW64 name..).<BR><BR>
So i spoiled your code from unusefull things (delimiters, arrayvalues, the call of Dumper.. but also the dump af all keys) and i add just a little code to show if the Perl version is 64bit. Most important i removed your Access special keys (more on that below) part <c>{Access=> 0x20019|0x0100}</c> and used the standard flag imported from [cpan://Win32API::Registry] ie <c>use Win32API::Registry qw(KEY_READ); .. Access=>KEY_READ()</c><BR><BR>
So the code became:
<c>
use strict;
use warnings;
use Win32API::Registry qw(KEY_READ);
use Config;
print "\n\nPerl $Config{archname}\n";
use Win32::TieRegistry(Delimiter=>"/");
my $uninstall=$Registry->Open(
"HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Uninstall",
{
Access=>KEY_READ()
#Access=> 0x20019|0x0100
}
);
print "Number of subkeys found: ".scalar(keys %$uninstall)."\n";
</c>
With my little Perl version test program i got theese results:
<CODE>
|
|
| Perl MSWin32-x86-multi-thread
| Number of subkeys found: 353
[OK] C:\ulisse\strawberry\perl\bin\perl.exe
|
|
| Perl MSWin32-x86-multi-thread-64int
| Number of subkeys found: 353
[OK] C:\ulisse\straw5.20-32b\perl\bin\perl.exe
|
|
| Perl MSWin32-x64-multi-thread
| Number of subkeys found: 77 <---- look here
[OK] C:\ulisse\straw64\perl\bin\perl.exe
|
|
| Perl MSWin32-x86-multi-thread-64int
| Number of subkeys found: 353
[OK] C:\ulisse\strP5.22-32\perl\bin\perl.exe
</CODE>
As the perl is 64bit the keys found are 77 on my workstation. 353 otherwise.<BR><BR>
Now i understood why you used thees special keys (described [href://https://msdn.microsoft.com/it-it/library/windows/desktop/ms724878(v=vs.85).aspx|here]) because <c>KEY_WOW64_64KEY (0x0100)</c> is not exported by [cpan://Win32API::Registry]. and you used it diractly in junction with <c>KEY_READ (0x20019)</c>.<BR><BR>
using <c>{Access=> 0x20019|0x0100}</c> access (uncomment it in the above example and comment the <c>Access=>KEY_READ()</c>) give theese results:
<c>
|
|
| Perl MSWin32-x86-multi-thread
| Number of subkeys found: 77
[OK] C:\ulisse\strawberry\perl\bin\perl.exe
|
|
| Perl MSWin32-x86-multi-thread-64int
| Number of subkeys found: 77
[OK] C:\ulisse\straw5.20-32b\perl\bin\perl.exe
|
|
| Perl MSWin32-x64-multi-thread
| Number of subkeys found: 77
[OK] C:\ulisse\straw64\perl\bin\perl.exe
|
|
| Perl MSWin32-x86-multi-thread-64int
| Number of subkeys found: 77
[OK] C:\ulisse\strP5.22-32\perl\bin\perl.exe
</c>
As you can see all Perls see only 77 unistallable programs.<strike> The description of the access mask tell us:<i>KEY_WOW64_32KEY (0x0200) Indicates that an application on 64-bit Windows should operate on the 32-bit registry view.</i>.. But is not true! is the opposite!</strike> UPDATE last senteces is wrong: see my last reply.<BR><BR>
If you see zero key returned on your machine, with your original code, it means to me that you have no 64bit applications uninstallable on your system (the opposite of what i read from ms docs!! in fact in the 77 subkey i find programs that resides in the 64bit program folder "C:\Program Files").Or using other words: if you use your special access flag you are probably looking for the wrong thing. try just reading them and be aware of the possible redirection occuring when you play the three card game with that OS.<br><br>HtH and let us know<br>L*<br><br>
<div class="pmsig"><div class="pmsig-174111">
There are no rules, there are no thumbs..<BR>
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
</div></div>
1147562
1147562