Ver Mensaje Individual
  #1  
Antiguo 13-03-2013
teecweb teecweb is offline
Miembro
NULL
 
Registrado: feb 2013
Posts: 64
Reputación: 14
teecweb Va por buen camino
Guardar todas las claves de registro en INNOSETUP

Holas , quisiera guardar todas las claves del registro de esta ruta
'\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'

guardarlo en una lista y despues recorrerlo preguntando por su displayName

Aqui les dejo un codigo en delphi pero yo quisiera hacerlo en innosetup ya que el codigo cambia un poco

gracias por su respuestas..
Código Delphi [-]

procedure ListarAplicaciones( Lista: TListBox );
const
  INSTALADOS = '\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall';
var
  Registro: TRegistry;
  Lista1 : TStringList;
  Lista2 : TStringList;
  j, n : integer;
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
      Lista.Items.Add( ( Registro.ReadString( Lista2.Strings[n] ) ) );
  end;

  Lista.Sorted := True; // Ordenamos la lista alfabéticamente
  Lista1.Free;
  Lista2.Free;
  Registro.CloseKey;
  Registro.Destroy;
end;
Responder Con Cita