2017-07-05 183 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