Hi,

I would like to check if some program installed on Win machine.

I wrote the following simple code to check it:

use Win32::Registry; # $SERVER_PLATFORM = x86 or x64 - i set it before in other function if ($SERVER_PLATFORM eq "x86") { $Registry = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ +5C65E4AB-BDF9-4784-968F-2FC6151B1637}'; } else { $Registry = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ +B2AE58F9-BF87-4345-9A48-B4C855A484FD}'; } if ($HKEY_LOCAL_MACHINE->Open($Registry,$hkey) ) { print "Found Software YYY installed on the machine\n"; } else { print "Software YYY does not installed on the machine\n"; }

The above code successfully run on 32 bit machine.

On 64 bit machine the product ID exist only under the following registry path:

SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B2AE58F9-BF87-4345-9A48-B4C855A484FD}

And doesn't exist under the default registry path (Wow6432Node folder):

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{B2AE58F9-BF87-4345-9A48-B4C855A484FD}

How I could make my program to read registry values on x64 bit machine from SOFTWARE\Microsoft\… and not from Wow6432Node folder

Please advice

Thanks

In reply to Perl registry reflection – How? by roteme

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.