2017-07-05 182 views
1

我很難將任務中的條件與GroupDescription結合起來。如果我不使用GroupDescription,它就可以工作。如果選擇了任務[2],我需要自動選擇任務[0]。我試過了:任務組條件inno setup

[Tasks] 
Name: InstallDS; Description: Install DServer?; GroupDescription: InsDS 
Name: InstallTG; Description: Install TServer?; GroupDescription: InsDS 
Name: InstallOP; Description: Install Optionals?; GroupDescription: InsDS 

[Code] 
procedure TasksListClickCheck(Sender: TObject); 
begin 
    WizardForm.TasksList.Checked[0] := WizardForm.TasksList.Checked[2]; 
end; 

procedure InitializeWizard; 
begin 
    WizardForm.TasksList.OnClickCheck := @TasksListClickCheck 
end; 

procedure CurPageChanged(CurPageID: Integer); 
begin 
    if CurPageID = wpSelectTasks then 
    begin 
     TasksListClickCheck(WizardForm.TasksList); 
    end; 
end; 

回答

2

一旦您添加GroupDescription,組下面的連續任務將被安排爲元素1,2,3。 Inno Tasks section description

procedure TasksListClickCheck(Sender: TObject); 
begin 
    if (WizardForm.TasksList.Checked[3] = True) then 
    begin 
     WizardForm.TasksList.Checked[1] := True; 
    end; 
end; 
+1

當您使用2組時,如上所述,第2組元素將是(5,6,7)。元素(4)用於組描述。這就是它的表現。 –

+0

[任務] 名稱:InstallDS01;說明:安裝DS01? GroupDescription:InsDS01。 名稱:InstallDS02;說明:安裝DS02? GroupDescription:InsDS02。 [代碼] 程序TasksListClickCheck(發件人:TObject); 開始 if(WizardForm.TasksList.Checked [2] = True)然後 開始 WizardForm.TasksList.Checked [1]:= True; 結束; 結束; 但沒有工作 – Robertopcn