Ver Mensaje Individual
  #10  
Antiguo 04-03-2013
teecweb teecweb is offline
Miembro
NULL
 
Registrado: feb 2013
Posts: 64
Reputación: 12
teecweb Va por buen camino
Talking

Holas si ya funciono.gracias...pero quisiera hacer una consulta mas:

Una vez que ya recorrio bien los indices y recuperar los nombres de los check se procede a desistalar :
por ejemplo la lista que se recorre:
c:\Program Files\rcv1.1\
c:\Program Files\rcv1.2\



Código Delphi [-]
procedure ButtonOnClick(Sender: TObject);
var
  i: Integer;
  var path,FileName: String;
begin
  path := CheckListBox1.Items[i];
if MsgBox('Do you really want to delete ' + ExtractFileDir(path) + '?', mbConfirmation, MB_YESNO) = idYes then
  begin
  for i:= 0 to CheckListBox1.Items.Count -1 do
             //unistaler
             begin
              if DirExists(ExtractFileDir(path)) then 
              begin
               CheckListBox1.Checked[i]:=true; 
//Aqui me llega un path por ejemplo : c:\Program Files\rcv1.2\ ..y dentro hay un directorio llamado
//Desinstalar dentro de este directorio hay un 'unins000.exe' y shellexec lo ejecuta mediante el procedimeinto 'desistalarItem'
                  FileName:=ExtractFileDir(path)+'\Desinstalar\'+'unins000.exe';
                     desistalarItem(FileName); 
               end    
               else
                          MsgBox('no existe',mbInformation, MB_OK);             
end;
end;         
end;
//procedimiento para desistalacion los .exe existentes
***********Mi dificultad es cuando shellexec se ejecuta ya sea para una desistalacion correcta o incorrecta sale del bucle y vuelve a recorrer el bucle..y yo en realidad no necesito que salga del bucle sino que siga con el siguiente indice..



si algo fallo en la desistalacion sale el error y sino ejecuta normalmente y el bucle empieza denuevo
y cuando el bucle empieza denuevo ahi es mi dificultad porque necesito que normalmente siga el bucle y no salga de el
Código Delphi [-]
 procedure desistalarItem(const FileName: string);
 var
  ErrorCode: Integer;
                     begin
                     if not ShellExec('',FileName,'', '', SW_SHOW, ewNoWait, ErrorCode) then
                           begin
                           // handle failure if necessary
                            MsgBox('DeinitializeSetup:' #13#13 'Execution of ''' + FileName + ''' failed. ' + SysErrorMessage(ErrorCode) + '.', mbError, MB_OK);
                           end
                     end;

por favor si hay alguna suegerencia estare muy pendiente..gracias por sus respuestas
Responder Con Cita