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

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

我要更改安装程序,请添加以下新选择:

  • 基本模式
  • 高级模式

作为首选。

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

如果用户选择高级模式,则安装程序的行为应与现在相同。

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

xukaizhan 回答:基本或高级安装模式选项可跳过或使用高级选项页面

使用CreateInputOptionPage function作为“模式”选择来创建自定义选项页面。并选择ShouldSkipPage event 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;

enter image description here

本文链接:https://www.f2er.com/3158951.html

大家都在问