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

It very much depends upon what you class as an "installed application"?

If your definition would be based upon that list of applications that you could uninstall using the Control_Panal->Add/remove Programs panel, then you can obtain that list from the registry under the key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall

Then simply enumerate all the entries and fetch the "DisplayName" value from each one.

Beyond that, anything installed that doesn't register itself with the MS mechanisms is not easily quantified or detected.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
  • 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 14:06 UTC
    Thanks for you help and information.

    I will try the registery approach.

    Regards

    BlackAdder
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:20 UTC
    Hi

    I tried this bit of code, however I did not get any information about the installed applications (only 'Done' was displyed).

    Can some one shed light on this for me please.

    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 for the help indeed.

      You need to distinguish between what are termed "Keys" and what "Values". This may get you started.

      #! perl -slw use strict; use Win32::Registry; use Data::Dumper; my $key; $HKEY_LOCAL_MACHINE->Open( "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall", $key ) or die $^E; my @keys; $key->GetKeys( \@keys ); for my $subkey ( @keys ) { $key->Open( $subkey, my $x ) or die $^E; my %vals; $x->GetValues( \%vals ); print Dumper \%vals; }

      You may also want to consider Win32::TieRegistry.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail