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

余生长醉 提交于 2020-01-23 21:12:15

问题


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:

  • 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?


回答1:


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;



来源:https://stackoverflow.com/questions/58713139/basic-or-advanced-installation-mode-choice-to-skip-or-use-advanced-options-pages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!