Inno setup 我想通过选择组件来创建页面

Inno setup 我想通过选择组件来创建页面,inno-setup,Inno Setup,我看到这段代码几乎满足了我的需要。 它会在您选择组件后创建一个页面,我可以在其中选择该文件夹中的“帮助”是否为“输入”的问题 我真正需要的是,如果您选择“帮助”转到第#1页,则不会选择另一个转到第#2页 如果所选组件为“帮助”,则转到第1页 如果所选组件不是“帮助”,则转到第2页 这个样品怎么没有达到你的要求?如果没有选择“帮助”组件,它将跳过自定义页。@Deanna,没有跳过第2页。呃,等等,没有第2页:-)Deanna和TLama,我想要的是“如果组件是a,则转到第1页”-“如果组件B将转到

我看到这段代码几乎满足了我的需要。 它会在您选择组件后创建一个页面,我可以在其中选择该文件夹中的“帮助”是否为“输入”的问题

我真正需要的是,如果您选择“帮助”转到第#1页,则不会选择另一个转到第#2页

如果所选组件为“帮助”,则转到第1页 如果所选组件不是“帮助”,则转到第2页


这个样品怎么没有达到你的要求?如果没有选择“帮助”组件,它将跳过自定义页。@Deanna,没有跳过第2页。呃,等等,没有第2页:-)Deanna和TLama,我想要的是“如果组件是a,则转到第1页”-“如果组件B将转到第2页”。请原谅我的英语,如果我不理解我,我的小经验。
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
OutputDir=userdocs:Inno Setup Examples Output

[Components]
Name: "help"; Description: "Help File";

[Code]
var
  CustomPageID: Integer;

procedure InitializeWizard;
var
  CustomPage: TInputDirWizardPage;
begin
  CustomPage := CreateInputDirPage(wpSelectComponents, 'Caption', 
    'Description', 'SubCaption', False, 'NewFolderName');
  CustomPage.Add('Input');
  // store your custom page ID to further use in the ShouldSkipPage event
  CustomPageID := CustomPage.ID;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  // initialize result to not skip any page (not necessary, but safer)
  Result := False;
  // if the page that is asked to be skipped is your custom page, then...
  if PageID = CustomPageID then
    // if the component is not selected, skip the page
    Result := not IsComponentSelected('help');
end;