基本或高级安装模式选项可跳过或使用高级选项页面 [英] Basic or Advanced installation mode choice to skip or use advanced options pages

查看:87
本文介绍了基本或高级安装模式选项可跳过或使用高级选项页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于Inno Setup的安装程序,它安装了三个应用程序,分为两个组件.现在,安装程序会要求用户提供安装目录以及要安装的组件.

I have a Inno Setup based installer that installs three applications, divided in two components. 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:

  • 基本模式
  • 高级模式

作为首选.

如果用户选择基本模式,则安装程序应跳过路径和组件选择,而仅使用默认值进行安装.

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.

有没有一种方法可以使用Inno Setup来实现?

There's a way to implement this using Inno Setup?

推荐答案

使用 ShouldSkipPage事件函数来跳过页面选择基本"模式.

Create a custom options page using CreateInputOptionPage function for your "mode" selection. And implement ShouldSkipPage event function to skip the pages when the "Basic" mode is selected.

[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;

这篇关于基本或高级安装模式选项可跳过或使用高级选项页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆