How do read and set the value of a checkbox in an InnoSetup wizard page?

后端 未结 2 1465
别那么骄傲
别那么骄傲 2020-12-16 02:54

I have added a checkbox to the \"Additional Tasks\" page of an InnoSetup script with

[Tasks]
Name: \"StartMenuEntry\" ; Description: \"Start my app when Wind         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-16 03:39

    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.

    [Tasks]
    Name: "InstallPython" ; Description: "Install Python"     ; Flags: checkedonce
    Name: "InstallNPP"    ; Description: "Install Notepad++"  ; Flags: checkedonce
    
    [Code]
    procedure CurPageChanged(CurPageID: Integer);
    var
    ItemIx: Integer;
    
    begin
        if CurPageID = wpSelectTasks then begin
            if not DirExists(ExpandConstant('{app}')) then begin
                for ItemIx := 0 to (WizardForm.TasksList.Items.Count - 1) do
                    WizardForm.TasksList.Checked[ItemIx] := True;
            end
        end
    end;
    

提交回复
热议问题