如何使用在“附加任务”面板中点击“下一步”按钮时必须执行的任务功能删除文件夹?
非常感谢先进。
答案 0 :(得分:1)
要检查是否选择了某项任务,您可以使用IsTaskSelected
功能。因此,为了满足您的要求,您可以写下这样的内容:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
[Tasks]
Name: deletefolder; Description: "Delete a folder"; GroupDescription: "Group Description:"
[Code]
function NextButtonClick(CurPageID: Integer): Boolean;
begin
// allow the setup turning to the next page
Result := True;
// if we are on the Additional Tasks page and the task is selected, then...
if (CurPageID = wpSelectTasks) and IsTaskSelected('deletefolder') then
// here call the RemoveDir or DelTree function depending on your needs
end;