windows - 基本或高级安装模式选择以跳过或使用高级选项页面
问题描述
我有一个基于 Inno Setup 的安装程序,它安装了三个应用程序,分为两个组件。现在安装程序询问用户安装目录和要安装的组件。
我想更改安装程序添加这个新选择:
- 基本模式
- 高级模式
作为首选。
如果用户选择基本模式,安装程序应该跳过路径和组件选择,只使用默认值进行安装。
如果用户选择高级模式,安装程序的行为应该像现在一样。
有一种方法可以使用 Inno Setup 来实现吗?
解决方案
CreateInputOptionPage
使用功能为您的“模式”选择创建自定义选项页面。并实现ShouldSkipPage
事件功能以在选择“基本”模式时跳过页面。
[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;
推荐阅读
- vue.js - 依赖升级后,bootstrap 和 bootstrap-vue 不再工作
- swift - DataTaskPublisher 未执行
- express - 如何使用下一个 js 和 firebase 在 getServerSideProps 中检索会话 cookie
- php - Laravel 项目中的空白登录页面
- sql - 我的回答与问题上的不一样
- node.js - 通过某些条件检索 mongodb 文档
- linux-kernel - open-file-description 表不像 Tanenbaum 在 Ubuntu 中描述的那样?
- python - 在 Python 的同一个类中从一个方法调用列表到另一个方法
- java - 使用时区偏移值解析 ZonedDateTime 字符串
- java - 如何组织一个java布局?