I have added a checkbox to the "Additional Tasks" page of an InnoSetup script with
[Tasks]
Name: "StartMenuEntry" ; Description: "Start my app when Windows starts" ; GroupDescription: "Windows Startup"; MinVersion: 4,4;
I want to initialize this checkbox when the wpSelectTasks
page shows, and read the value when the Next
button is clicked. I can't work out how to access the checkbox `checked' value.
function NextButtonClick(CurPageID: Integer): Boolean;
var
SelectTasksPage : TWizardPage ;
StartupCheckbox : TCheckbox ;
begin
Result := true ;
case CurPageID of
wpSelectTasks :
begin
SelectTasksPage := PageFromID (wpSelectTasks) ;
StartupCheckbox := TCheckbox (SelectTasksPage... { <== what goes here??? }
StartupCheckboxState := StartupCheckbox.Checked ;
end ;
end ;
end ;
Great answer above. Gave me just what I needed.
I had a case where I have a bunch of secondary installers that I used the 'checkonce' option on, but I wanted them to be re-checked if the folder was missing (e.g. the user wiped out the install folder manually), e.g.
The task check boxes are in fact items in the
WizardForm.TasksList
check list box. If you know their indexes you can access them pretty easily. Note, that the items can be grouped (what is just your case) and each new group takes also one item in that check list box, so for your case the item index will be 1:Here is illustrated how the
WizardForm.TasksList
check list box would looks like when you'd have two tasks with different groups:To access the task check box by its description try the following: