teecweb,
Cita:
Empezado por teecweb
...y cuando el bucle empieza denuevo ahi es mi dificultad porque necesito que normalmente siga el bucle y no salga de el...
|
El código que publicastes en el
Msg #10 lo modifique
según entiendo como debería funcionar tu Desinstalador en Inno Setup.
Revisa este código:
Código Delphi
[-]
procedure ButtonOnClick(Sender: TObject);
var
i : Integer;
path,FileName : String;
begin
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
begin
path := CheckListBox1.Items[i];
if CheckListBox1.Checked[i] = true then
if DirExists(ExtractFileDir(path)) then
begin
FileName := ExtractFileDir(path) + '\Desinstalar' + '\unins000.exe';
DesistalarItem(FileName);
end
else
MsgBox('No Existe un Desinstalador Asociado',mbInformation, MB_OK);
end;
end;
end;
procedure DesistalarItem(const FileName: string);
var
ErrorCode : Integer;
begin
if not Exec(FileName,'', '', SW_SHOW, ewWaitUntilTerminated, ErrorCode) then
begin
MsgBox('DeinitializeSetup:' #13#13 'Execution of ''' + FileName + ''' failed. ' + SysErrorMessage(ErrorCode) + '.', mbError, MB_OK);
end
end;
El código anterior
recorre el arreglo de Items del control TCheckListbox y por cada item seleccionado llama al procedimiento DesistalarItem
El cambio de
ShellExec por
Exec esta basado en la información de este link:
http://www.jrsoftware.org/ishelp/ind...=scriptclasses
Nota: Este código no esta probado en Inno Setup.
Espero sea útil
Nelson.