如果用户在安装过程中检查相应的复选框,我想执行一些代码。从阅读帮助文件看来,使用该任务的唯一方法是将其与Files/Icons /等中的条目相关联。部分。我真的很想将它与代码部分的过程联系起来。这可以做到,如果是这样,怎么样?通过Inno Setup中的任务启动自定义代码
6
A
回答
4
你做到这一点通过添加一个有复选框,并执行代码,所有选中的复选框,当用户点击“下一步”,在该网页上的自定义向导页:
[Code]
var
ActionPage: TInputOptionWizardPage;
procedure InitializeWizard;
begin
ActionPage := CreateInputOptionPage(wpReady,
'Optional Actions Test', 'Which actions should be performed?',
'Please select all optional actions you want to be performed, then click Next.',
False, False);
ActionPage.Add('Action 1');
ActionPage.Add('Action 2');
ActionPage.Add('Action 3');
ActionPage.Values[0] := True;
ActionPage.Values[1] := False;
ActionPage.Values[2] := False;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
if CurPageID = ActionPage.ID then begin
if ActionPage.Values[0] then
MsgBox('Action 1', mbInformation, MB_OK);
if ActionPage.Values[1] then
MsgBox('Action 2', mbInformation, MB_OK);
if ActionPage.Values[2] then
MsgBox('Action 3', mbInformation, MB_OK);
end;
end;
的复选框既可以成为列表框中的标准控件或项目,有关详细信息,请参阅Pascal脚本的Inno安装文档。
如果您希望根据是否选择某个组件或任务来执行您的代码,请改为使用IsComponentSelected()
和IsTaskSelected()
函数。
11
你不需要定义你自己的向导页面。您可以将它们添加到其他任务页面。
[Tasks]
Name: associate; Description:"&Associate .ext files with this version of my program"; GroupDescription: "File association:"
[Code]
function NextButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
if CurPageID = wpSelectTasks then
begin
if WizardForm.TasksList.Checked[1] then
MsgBox('First task has been checked.', mbInformation, MB_OK);
else
MsgBox('First task has NOT been checked.', mbInformation, MB_OK);
end;
end;
对于this post,信贷去TLama。
相关问题
- 1. Inno Setup自定义页面
- 2. 如何跳过启动在inno setup中选择的特定任务的消息?
- 3. Inno Setup在[代码]
- 4. Inno Setup - 检索自定义值
- 5. 自定义TaskScheduler通过DateTime启动任务
- 6. Android源代码 - 写入自定义服务启动启动
- 7. Inno Setup如何始终检查任务?
- 8. 是否可以通过Inno Setup接受自定义命令行参数
- 9. Inno Setup - 等待Postgres数据库启动
- 10. Inno Setup中的自定义磁盘跨越
- 11. Inno Setup/SUPPRESSMSGBOXES定制
- 12. 注册自定义PageHandlerFactory通过代码
- 13. Inno Setup - 自动提交卸载提示
- 14. Inno Setup的指定安装
- 15. Inno Setup适用于Chrome的自定义网址
- 16. 通过自定义文本链接到代码自动
- 17. GetComputerNameString Inno Setup的
- 18. Inno Setup:添加自定义输入字段
- 19. Inno Setup - 创建自定义消息框(是/否)
- 20. Inno Setup:创建自定义向导页面AFTER组件选择
- 21. 在Inno Setup的[Code]中重新启动计算机
- 22. 在Windows XP和Inno Setup中迭代SWbemObjectSet
- 23. 使用C代码启动任务
- 24. 通过Spring启动异步任务TaskScheduler
- 25. 如何在Inno Setup中读取INF文件中的自定义值?
- 26. 如何中止Inno Setup的
- 27. Inno Setup中的MySQL查询
- 28. inno setup中的注册表
- 29. 使用Inno Setup的
- 30. Inno Setup的:在TInputQueryWizardPage