Question

I need a simple thing: have advance and normal installation buttons. For normal case it is all simple - I used default next button with some logic on NextButtonClick to set a condition variable and skeep some pages using ShouldSkipPage . Yet for advanced setup I created a new button and all I need it to do on click is to open next installer page:

procedure CurPageChanged(CurPageID : Integer);
begin
if CurPageID = wpWelcome then begin
    AdvancedButton := TButton.Create(WizardForm);
    AdvancedButton.Caption := 'Advanced Install';
    AdvancedButton.Left := WizardForm.InfoAfterPage.Left + 10;
    AdvancedButton.Top := WizardForm.InfoAfterPage.Height + 88;
    AdvancedButton.Parent := WizardForm.NextButton.Parent;
    # AdvancedButton.OnClick :=  What shall I call to open say next page (or some page by given PageID value)
    end
    else begin
    AdvancedButton.Visible := False;
    end;

end;

So What shall I call to open say next page (or some page by given PageID value) on my button click (could not find any NextPage or some SetPage function in Inno API)?

No correct solution

OTHER TIPS

There is no such thing as "Direct jump to page" in Inno Setup. All you need is to quietly skip certain pages in 'Advanced mode'.

Simply do the same as in regular installer. Set one variable for holding 'Advanced mode'. After clicking the Advance button:

[Code]
var
  IsAdvanced: Boolean;

procedure AdvancedButtonClick(Sender: TObject);
begin
  IsAdvanced := True;
  WizardForm.NextButton.OnClick(nil);
end;

procedure InitializeWizard;
var
  AdvancedButton: TNewButton;
begin
  // not necessary; just for sure
  IsAdvanced := False;
  // create the button
  AdvancedButton := TNewButton.Create(WizardForm);
  AdvancedButton.Caption := 'Advanced Install';
  AdvancedButton.Left := WizardForm.InfoAfterPage.Left + 10;
  AdvancedButton.Top := WizardForm.InfoAfterPage.Height + 88;
  AdvancedButton.Parent := WizardForm.NextButton.Parent;
  AdvancedButton.OnClick := @AdvancedButtonClick;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  // the <page where you want to end up> fill with the wizard page constant
  // of the page where you want to end up, e.g. wpReady
  Result := IsAdvanced and (PageID <> <page where you want to end up>);
end;

With this logic you can simulate quiet 'jump' to certain page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top