Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: location of application installed and executable

by tachyon (Chancellor)
on Oct 08, 2001 at 15:17 UTC ( #117432=note: print w/ replies, xml ) Need Help??


in reply to location of application installed and executable

Here is a more complete example that gets the install root for you as well:

use Win32API::Registry 0.21 qw( :ALL ); my @software = qw ( Excel Word Outlook PowerPoint Perl ); for my $software (@software) { my ( $key, $type, $data ); print RegOpenKeyEx( HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Offi +ce\\9.0\\$software\\InstallRoot", 0, KEY_READ, $key ) ? "$software has registry key\n" : "$software seems to be missing ". +regLastError()."\n"; print RegQueryValueEx( $key, "Path", [], $type, $data, [] ) ? "Install Root: $data\n" : "$software ".regLastError()."\n"; } __END__ Excel has registry key Install Root: C:\Program Files\Microsoft Office\Office\ Word has registry key Install Root: C:\Program Files\Microsoft Office\Office\ Outlook has registry key Install Root: C:\Program Files\Microsoft Office\Office\ PowerPoint has registry key Install Root: C:\Program Files\Microsoft Office\Office\ Perl seems to be missing The system cannot find the file specified Perl The configuration registry key is invalid

Note that 9.0 represents Office 2000

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


Comment on Re: location of application installed and executable
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://117432]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2015-08-01 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (285 votes), past polls