Hola teecweb.
Mi respuesta fué por el título de tu primer mensaje "Agregar ID a checkboxlist en delphi", pero tratándose de
Inno setup cambia un poco la cosa.
Nunca había realizado un script para
Inno setup, pero basándome en parte en tu código y revisando un poco aquí:
Pascal Scripting: Support Classes Reference, hice unas pruebas y en este ejemplo se muestran el texto y los índices de los items seleccionados en el
TNewChekListBox como respuesta del evento
OnClick de Buttona:
Código Delphi
[-]
[Setup]
AppName='Test'
AppVerName='Test'
DefaultDirName=\test
[code]
var
Page: TWizardPage;
Buttona: TNewButton;
CheckListBox1: TNewCheckListBox;
procedure ButtonOnClick(Sender: TObject);
var
i: Integer;
begin
for i:= 0 to CheckListBox1.Items.Count -1 do
if CheckListBox1.Checked[i] then MsgBox('Caption: ' + CheckListBox1.Items[i]+ #10#13 + 'Indice : ' + IntToStr(i), mbInformation, MB_OK); end;
procedure CreateTheWizardPages;
var
inicio: Integer;
scale : Integer;
begin
Page := CreateCustomPage(wpSelectDir, 'Custom wizard page controls', 'TButton and others');
Buttona := TNewButton.Create(Page);
Buttona.Width := ScaleX(75);
Buttona.Height := ScaleY(23);
Buttona.Caption := 'TNewButton';
Buttona.Parent := Page.Surface;
Buttona.Visible := true;
Buttona.OnClick := @ButtonOnClick;
CheckListBox1 := TNewCheckListBox.Create(Page);
CheckListBox1.Width := 410;
CheckListBox1.Height := 180;
CheckListBox1.Parent := Page.Surface;
CheckListBox1.ItemIndex:= 0;
CheckListBox1.Top := Buttona.Top + Buttona.Height + ScaleY(scale);
for inicio:= 1 to 5 do
CheckListBox1.AddCheckBox('Item' + IntToStr(inicio), IntToStr(inicio), 0, False, True, True, True, nil);
end;
procedure InitializeWizard();
begin
CreateTheWizardPages
end;
Espero te oriente para lograr lo que estás buscando.
Saludos.