1
votes

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

1 Answers

2
votes

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;

enter image description here