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;
with Registro do
begin
RootKey := HKEY_LOCAL_MACHINE;
OpenKey( INSTALADOS, False );
GetKeyNames( Lista1 );
end;
for j := 0 to Lista1.Count-1 do
begin
Registro.OpenKey( INSTALADOS + '\' + Lista1.Strings[j], False );
Registro.GetValueNames( Lista2 );
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; Lista1.Free;
Lista2.Free;
Registro.CloseKey;
Registro.Destroy;
end;