简体   繁体   English

基本或高级安装模式选择以跳过或使用高级选项页面

[英]Basic or Advanced installation mode choice to skip or use advanced options pages

I have a Inno Setup based installer that installs three applications, divided in two components.我有一个基于 Inno Setup 的安装程序,它安装了三个应用程序,分为两个组件。 Now the setup asks the user for the installation directory and which components to install.现在安装程序询问用户安装目录和要安装的组件。

I want to change the installer add this new choice:我想更改安装程序添加这个新选择:

  • Basic mode基本模式
  • Advanced mode高级模式

as the first choice.作为首选。

If the user selects the Basic mode the installer should skip path and component choice and just install using default values.如果用户选择基本模式,安装程序应该跳过路径和组件选择,只使用默认值进行安装。

If the user selects the Advanced mode the installer should behaves like now.如果用户选择高级模式,安装程序的行为应该像现在一样。

There's a way to implement this using Inno Setup?有一种方法可以使用 Inno Setup 来实现吗?

Create a custom options page using CreateInputOptionPage function for your "mode" selection.使用CreateInputOptionPage function为您的“模式”选择创建自定义选项页面。 And implement ShouldSkipPage event function to skip the pages when the "Basic" mode is selected.并执行ShouldSkipPage事件 function以在选择“基本”模式时跳过页面。

[Code]
var
  ModePage: TInputOptionWizardPage;

procedure InitializeWizard();
begin
  ModePage :=
    CreateInputOptionPage(
      wpWelcome, 'Installation mode', 'Select installation mode', '', True, False);
  ModePage.Add('Basic mode');
  ModePage.Add('Advanced mode');
  ModePage.Values[0] := True; { Select Basic mode by default }
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  { If "Basic" mode is selected, skip Directory and Components pages }
  Result := 
    ModePage.Values[0] and
    ((PageID = wpSelectDir) or (PageID = wpSelectComponents));
end;

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM