Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to skip all the wizard pages and go directly to the installation process?

Tags:

inno-setup

At this time I'm using 3 wizard pages (Preparing to Install, Installing and Finished page) in my installer.

I want to keep the process as simple as possible, so I would like to reduce this to just 2 pages (Installing and Finished page).

Is there a way to skip all the wizard pages and go directly to the installation process when the installer starts ?

like image 703
Andre Garcia Avatar asked Dec 05 '22 07:12

Andre Garcia


1 Answers

Proper way is to disable all the pages by the following directives:

DisableWelcomePage=yes
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyPage=yes

But, even if you do so, the ready page will still show. I've tried to find a way how to properly skip this page and go directly to the installation step with no success. I haven't checked what's happening inside, but so far I found a workaround in posting a click notification message to the next button which triggers the click event and moves to the installation process:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
DisableWelcomePage=yes
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyPage=yes
[Code]
const
  BN_CLICKED = 0;
  WM_COMMAND = $0111;
  CN_BASE = $BC00;
  CN_COMMAND = CN_BASE + WM_COMMAND;

procedure CurPageChanged(CurPageID: Integer);
var
  Param: Longint;
begin
  { if we are on the ready page, then... }
  if CurPageID = wpReady then
  begin
    { the result of this is 0, just to be precise... }
    Param := 0 or BN_CLICKED shl 16;
    { post the click notification message to the next button }
    PostMessage(WizardForm.NextButton.Handle, CN_COMMAND, Param, 0);
  end;
end;

That will work, but I still hope there's a cleaner way to skip all the pages and go directly to the installation process.

like image 171
TLama Avatar answered Jan 17 '23 22:01

TLama