Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 13-03-2013
teecweb teecweb is offline
Miembro
NULL
 
Registrado: feb 2013
Posts: 64
Poder: 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
  #2  
Antiguo 13-03-2013
[maeyanes] maeyanes is offline
Capo de los Capos
 
Registrado: may 2003
Ubicación: Campeche, México
Posts: 2.732
Poder: 26
maeyanes Va por buen camino
Hola...

Lo que tienes que haces es usar arreglos de string para obtener la lista de subkeys con la función RegGetSubkeyNames y el valor de DisplayName usando la función RegQueryStringValue, la misma ayuda de InnoSetup tiene ejemplos.

Código Delphi [-]
const
  UninstallKey = '\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall';
var
  Installed: TArrayOfString;
  I: Integer;
  AppName: string;
  AppNameList: TStringList;

begin
  if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, UninstallKey, Installed) then
  begin
    AppNameList := TStringList.Create;
    AppNameList.Sorted := True;
    for I := 0 to GetArrayLength(Installed) do
      if RegQueryStringValue(HKEY_LOCAL_MACHINE, UninstallKey + '\' + Installed[i], 'DisplayName', AppName) and (AppName <> '') then
        AppNameList.Add(AppName)
  end
end;



Saludos...
__________________
Lee la Guía de Estilo antes que cualquier cosa. - Twitter
Responder Con Cita
  #3  
Antiguo 13-03-2013
teecweb teecweb is offline
Miembro
NULL
 
Registrado: feb 2013
Posts: 64
Poder: 14
teecweb Va por buen camino
gracias ..ya lei la ayuda y encontre la funcion..y justamente coincidimos con la respuestas..igualemnte gracias
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
¿Cómo Claves de Registro en Innosetup? danielmania8 Varios 2 02-11-2011 13:54:11
Guardar claves de acceso de forma segura yapt Varios 2 16-01-2010 22:51:53
Claves de registro rauros Varios 8 05-03-2008 16:51:49
Crear Claves de registro con InnoSetup FGarcia Varios 2 17-10-2006 06:00:59
Generar claves en registro Pablo Carlos API de Windows 2 02-07-2004 00:57:43


La franja horaria es GMT +2. Ahora son las 00:19:50.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi