Ver Mensaje Individual
  #1  
Antiguo 22-09-2010
Avatar de vroa74
vroa74 vroa74 is offline
Miembro
 
Registrado: jul 2006
Posts: 254
Reputación: 18
vroa74 Va por buen camino
Question listados de software instalado

requiero obtener un listado del software instalado en windows vista y windows 7. ya que he corrido una rutina que encontre en la res mas solo funciona en windows xp.
en windows vista y windows 7 no me aroja nada..
alguien puede ayudarme ??????

Les dejo el codigo que encontre ...
gracias por la ayuda....



Código Delphi [-]
procedure TForm1.ListarAplicaciones( Lista: TListBox );
const
  INSTALADOS = '\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall';
var
  Registro: TRegistry;
  Lista1 : TStringList;
  Lista2 : TStringList;
  j, n : integer;
  auxx : string;
begin
  Registro := TRegistry.Create;
  Lista1 := TStringList.Create;
  Lista2 := TStringList.Create;   // Guardamos todas las claves en la lista 1
  with Registro do
  begin
    RootKey := HKEY_LOCAL_MACHINE;
    OpenKey( INSTALADOS, False );
    GetKeyNames( Lista1 );
  end;    // Recorremos la lista 1 y leemos el nombre del programa instalado
  for j := 0 to Lista1.Count-1 do
  begin
    Registro.OpenKey( INSTALADOS + '\' + Lista1.Strings[j], False );
    Registro.GetValueNames( Lista2 );    // Mostramos el programa instalado sólo si tiene DisplayName
    n := Lista2.IndexOf( 'DisplayName' );
    if ( n <> -1 ) and ( Lista2.IndexOf('UninstallString') <> -1 ) then
    begin  //      Listbox1.Items.Add( ( Registro.ReadString( Lista2.Strings[n] ) ) );
      RichEdit1.Lines.Add( (chr(9)+'-'+Registro.ReadString( Lista2.Strings[n] ) )+#9+auxx );
    end;
  end;   //  Listbox1.Sorted := True; // Ordenamos la lista alfabéticamente
  Lista1.Free;
  Lista2.Free;
  Registro.CloseKey;
  Registro.Destroy;
end;
Responder Con Cita