How to skip custom page based on setup type in Inno Setup

前端 未结 1 1696
我在风中等你
我在风中等你 2021-01-07 12:24

I\'m building my setup with server and client installation/setup types. I need to skip or hide a custom page if user choose server type. Server type only have a custom page

相关标签:
1条回答
  • 2021-01-07 13:02

    In ShouldSkipPage event function, compare the PageID against the TWizardPage.ID of the custom page. And use WizardSetupType support function to test the selected setup type.

    var
      Page: TWizardPage;
    
    function ShouldSkipPage(PageID: Integer): Boolean;
    begin
      Result := False;
    
      if Page.ID = PageID then
        Result := (WizardSetupType(False) <> 'server');
    end;
    

    And obviously, your custom page must show after the "Select Components" page, not before:

    Page := CreateCustomPage(wpSelectComponents, ...);
    

    Alternatively, you can handle TWizardPage.OnShouldSkipPage of the custom page.

    0 讨论(0)
提交回复
热议问题