任务部分 - 添加了2个任务,但始终安装

时间:2015-03-22 14:35:28

标签: inno-setup

我试图在[tasks]部分添加2个可选组件,但即使没有选择它们也会安装。以下是我正在使用的内容:

[Types]

Name: "custom"; Description: "Custom installation"; Flags:iscustom


[Components]

Name: "A"; Description: {#DescriptionA};Types:custom;
Name: "B"; Description: {#DescriptionB};Types:custom; 
Name: "B"; Description: {#DescriptionC};Types:custom; 
Name: "D"; Description: {#DescriptionD};Types:custom; 
Name: "E"; Description: {#DescriptionE};Types:custom; 

[Tasks]

Name:'F'; Description: {#DescriptionF}; 
Name:'G'; Description: {#DescriptionG};

[Files]

Source: {#SourceA}; Components: A; DestDir: {#FinalDestination}; Flags:     onlyifdoesntexist;
Source: {#SourceB};  Components: B; DestDir: {#FinalDestination}; Flags: onlyifdoesntexist;
Source: {#SourceC}; Components: C; DestDir: {#FinalDestination}; Flags: onlyifdoesntexist;
Source: {#SourceD}; Components: D; DestDir: {#Destination}; Flags: onlyifdoesntexist;
Source: {#SourceE}; Components: E; DestDir: {#Destination}; Flags:
onlyifdoesntexist;
Source: {#SourceF}; DestDir: {#Destination}; Flags:  onlyifdoesntexist;
Source: {#SourceG}; DestDir: {#Destination}; Flags: onlyifdoesntexist;

我做错了什么?感谢

1 个答案:

答案 0 :(得分:1)

如果您想要有条件地安装文件,那么您必须根据选中或取消选中的复选框添加任务/组件参数以使文件正常工作。没有参数(Tasks: '*'Components: '*'){{1每次都会安装。

因此,这是根据组件和任务复选框有条件地安装文件的正确脚本:

Files