Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How to obtain a list of software applications installed on a Win based PC?

by wufnik (Friar)
on Jun 01, 2004 at 13:57 UTC ( [id://358060]=note: print w/replies, xml ) Need Help??


in reply to How to obtain a list of software applications installed on a Win based PC?

in line with davidj's suggestion, here is some code which will give you a list of the software in HKEY_LOCAL_MACHINE/SOFTWARE.

add other relevant registry keys to taste.
my %RegHash; use Win32::TieRegistry( TiedHash => \%RegHash, Delimiter => "/"); my $registry = \%RegHash; @regkeys = keys %{$registry->{'HKEY_LOCAL_MACHINE/SOFTWARE/'}}; print join "\n", @regkeys;
all the best...
...wufnik

-- in the world of the mules there are no rules --
  • Comment on Re: How to obtain a list of software applications installed on a Win based PC?
  • Download Code

Replies are listed 'Best First'.
Re: Re: How to obtain a list of software applications installed on a Win based PC?
by Anonymous Monk on Jun 01, 2004 at 15:42 UTC
    THANKS FOR THIS,...I think it worked! although it dumped out stuff that i don't think that they are installed applications!

    here is the output
    ActiveState/ Adobe/ Apple Computer, Inc./ ArcSoft/ C07ft5Y/ Classes/ Clients/ DataDirect/ Documentum/ Gemplus/ IDM Computer Solutions, Inc./ InstalledOptions/ InstallShield/ Intel/ JavaSoft/ L&H/ Licenses/ Microsoft/ Netscape/ Nikon/ NVIDIA Corporation/ ODBC/ Perl/ pixology/ PlaceWare/ Policies/ Program Groups/ Reflectent/ Schlumberger/ Secure/ SYBASE/ Symantec/ VisionShape/ VMware, Inc./ Wilson WindowWare/ Windows 3.1 Migration Status/ Description/
    This output is very ambigouis! I have Office2003 installed and What I excpected is to see WinWord, Excel, OutLook, Access all to be listed. Also I have never seen -or heard -of some of the listed software in the above output!! So I don't understand what went on there!

    Is it possible to use this code below to obtain the information - once it get de-bugged and since I can understand it a bit better than the one using the Registry tie?
    use strict; use Win32::Registry; my $Key; if ($HKEY_LOCAL_MACHINE->Open("Software\\Microsoft\\Windows\\CurrentVe +rsion\\Uninstall", $Key)) { print "\nDone1\n"; my %ValueList; $Key->GetValues(\ %ValueList); # nothing happens here! for my $item (keys(%ValueList)) # nor here { print "\nDone2 $item\n"; print "$item : $ValueList{$item}[2]\n"; } print $Key->{DisplayName}."\n"; $Key->Close(); }
    Thanks & Your Help is highly appreciated.

      Here's what you are looking for.

      #!perl use warnings; use strict; use Data::Dumper; my $Registry; use Win32::TieRegistry ( Delimiter=>"/", ArrayValues=>1, TiedRef => \$Registry, ); my @install_names; foreach my $software ( values %{$Registry->{'HKEY_LOCAL_MACHINE/Softwa +re/Microsoft/Windows/CurrentVersion/Uninstall/'}} ) { next unless my $software = $software->{DisplayName}; next unless $software->[0]; push @install_names, $software->[0]; } print "$_\n" for sort {lc $a cmp lc $b} @install_names;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-20 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found