Key standard Inno Setup

I added InputOptionWizardPage to select tasks. This works great, but I would like to add some custom features. One task depends on another, therefore, if the second check box is selected, the first should be checked and grayed out.

To do this, I need to access the properties of the checkbox. I found ways to do this using a fully customizable page where I would explicitly create a checkbox myself, but that would be a lot of work, since most of what I still have is satisfactory.

How can I check the box created by Inno Setup using MyInputOptionWizardPage.Add('This will add a checkbox with this caption')?

+5
source share
2 answers

In an attempt to answer your question directly.

, CreateInputOptionPage(), TInputOptionWizardPage

.Add('') `, .

TInputOptionWizard descends TWizardPage, TComponent, .

: , , InnoSetup ScriptClasses_C.pas , TRadioButton TCheckBox, . TNewCheckListBox. , - , - .

Inno Setup Script.

[Setup]
AppName='Test Date Script'
AppVerName='Test Date Script'
DefaultDirName={pf}\test
[Code]

const
 cCheckBox = false;
 cRadioButton  = true;


var
  Opt : TInputOptionWizardPage; 

function BoolToStr(Value : Boolean) : String; 
begin
  if Value then
    result := 'true'
  else
    result := 'false';
end;

procedure ClickEvent(Sender : TObject);
var
 Msg : String;
 I   : Integer;
begin
   // Click Event, allowing inspection of the Values.
    Msg := 'The Following Items are Checked' +#10#13; 
    Msg := Msg + 'Values[0]=' + BoolToStr(Opt.Values[0]) +#10#13;
    Msg := Msg + 'Values[1]=' + BoolToStr(Opt.Values[1]) +#10#13;
    Msg := Msg + 'Values[2]=' + BoolToStr(Opt.Values[2]);

    MsgBox(Msg,mbInformation,MB_OK);
end;
procedure InitializeWizard();
var
  I : Integer; 
  ControlType : Boolean;
begin
  ControlType := cCheckBox;
  Opt := CreateInputOptionPage(1,'Caption','Desc','SubCaption',ControlType, false);
  Opt.Add('Test1');
  Opt.Add('Test2');
  Opt.Add('Test3');

  // Assign the Click Event.
  Opt.CheckListBox.OnClickCheck := @ClickEvent;  
end;
+10

, , , 100% . , , , . , .

[Setup]
;This allows you to show Lines showing parent / Child Relationships
ShowTasksTreeLines=yes

[Tasks]
;Parent Tasks don't use "\"
Name: p1; Description: P1 Test; 
;Child Tasks are named ParentTaskName\ChildTaskName
;Flag don't inheritcheck:Specifies that the task 
;should not automatically become checked when its parent is checked 
Name: p1\c1; Description: C1 Test; Flags: dontinheritcheck;
Name: p1\c2; Description: C2 Test; 
;Default behavior is that child must be selected 
;when a parent is selected
;this can be overridden using the:
;doninheritcheck flag and the checkablealone flag.
Name: p2; Description: P2 Test; Flags: checkablealone;
Name: p2\c1; Description: P2-C1 Test; Flags: dontinheritcheck;
Name: p2\c2; Description: P2-C2 Test; Flags: dontinheritcheck;
0

All Articles