5

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 ?

TLama
  • 75,147
  • 17
  • 214
  • 392
Andre Garcia
  • 894
  • 11
  • 30

2 Answers2

14

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.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
TLama
  • 75,147
  • 17
  • 214
  • 392
  • 1
    P.S. oh, and yes, I've tried to call the `WizardForm.NextButton.OnClick` event method instead of that message posting. No effect. – TLama Mar 04 '14 at 23:15
  • It worked very well! Thank you! :) By the way, i am having some difficult in getting more extensive documentation about the events and functions available so we can use. Can you reference any good book or url? Inno setup seems very good. In your opinion is it the best free opensource software? Thank you once more! – Andre Garcia Mar 05 '14 at 00:11
  • You're welcome! But maybe we'll find a "cleaner" way than this (though it is a reliable way, it is quite "hacky"). About docs; except official help which covers almost everything you'll ever need in Inno Setup, I would recommend e.g. [`this blog`](http://www.mirality.co.nz/inno/tips.php) (you can meet the author of that blog on StackOverflow under the nick Miral). A few links are also recommended [`by the authors`](http://www.jrsoftware.org/islinks.php). – TLama Mar 05 '14 at 00:45
  • I've checked the source and the minimium of one page to interact with before the installation (as Miral describes) is intentional. So, this is my final solution... It is reliable, but hacky due to that limitation. – TLama Mar 09 '14 at 22:31
  • I used this to created a custom /SilentMode for upgrades that is silent unless the terms and conditions changed from the previous accepted terms. If its changed I only show the the agreement page else I skip everything I – AL - Lil Hunk Jul 20 '17 at 21:55
  • For this to work, you also cannot have any [Tasks] such as creating icons..... – Erik Schroder May 30 '23 at 15:56
3

You cannot jump straight to Installing in an interactive (user directly ran the installer) context. Inno requires that at least one page be shown beforehand to allow the user to cancel the installation. It's up to you which page it shows, but there must be at least one.

(If it weren't for this, there'd be many annoyed users who ran the installer accidentally and many more hit by drive-by malware installs.)

If you are installing from an automated context (eg. your app has just downloaded an update) then you can skip straight to the installation by using the /SILENT command line parameter when running the installer.

Miral
  • 12,637
  • 4
  • 53
  • 93
  • Well, uhm, you shouldn't, but you can. Workaround is a bit tricky, but still reliable. – TLama Mar 05 '14 at 21:17
  • Perhaps, but that just means that you should have had second thoughts before giving the malware authors more ammunition. It's better not to encourage them in the first place. :) – Miral Mar 06 '14 at 00:43
  • I would personally prefer to hide the evil part of a malicious installer behind a regular wizard :) – TLama Mar 06 '14 at 07:48
  • Personally i don´t like not having nothing to prompt the user and i would be a lot more suspicious of malicious activity this way then a regular install. The software i developed is intended to older people. Any prompt question is a new world for them. :) I just want to easy things a little. I need them with confidence to face the real problem, my software! :) – Andre Garcia Mar 07 '14 at 11:06
  • 1
    In a situation where you are patching an existing program then often the software has already asked the user if they want to upgrade - in that case you very well may not want more annoying prompts. – Erik Schroder Jun 08 '17 at 14:12
  • @JohnLamberis That's why options like `/SILENT` exist -- if you're running it from another installer or from your application to update itself, this removes the annoying prompts, while still ensuring that the user sees them when they run the installer normally. – Miral Jun 08 '17 at 23:24
  • At least one page: could it be the Welcome page? "Welcome, update?" - "Yes thanks, jump to reinstall" – Sandburg Feb 08 '19 at 11:26
  • Yes, the one page can be the welcome page, if you enable it. – Miral Feb 11 '19 at 02:35