如果用戶在安裝過程中檢查相應的複選框,我想執行一些代碼。從閱讀幫助文件看來,使用該任務的唯一方法是將其與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. Inno Setup的:自定義消息
- 6. Inno Setup的自定義頁面嚮導
- 7. 可以定義Inno Setup的
- 8. Inno Setup - 檢索自定義值
- 9. 自定義TaskScheduler通過DateTime啓動任務
- 10. Inno Setup中的等效升級代碼
- 11. Inno Setup的任務欄圖標
- 12. 通過inno setup創建一個vb6安裝程序與mysql通過inno setup
- 13. Android源代碼 - 寫入自定義服務啓動啓動
- 14. Inno Setup如何始終檢查任務?
- 15. Inno Setup的:根據產品代碼
- 16. 是否可以通過Inno Setup接受自定義命令行參數
- 17. Inno Setup - 等待Postgres數據庫啓動
- 18. Inno Setup中的自定義磁盤跨越
- 19. 如何通過代碼特定任務
- 20. Inno Setup/SUPPRESSMSGBOXES定製
- 21. Inno Setup Compiler:如何使用給定的URL自動啓動默認瀏覽器?
- 22. 更改來自Pascal代碼的Inno Setup消息
- 23. 註冊自定義PageHandlerFactory通過代碼
- 24. Inno Setup - 自動提交卸載提示
- 25. Inno Setup的指定安裝
- 26. Inno Setup SignTool密碼請求
- 27. Inno Setup的自定義更換卸載模態窗口
- 28. Inno Setup適用於Chrome的自定義網址
- 29. 通過自定義文本鏈接到代碼自動
- 30. GetComputerNameString Inno Setup的