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

后端 未结 2 1355
挽巷
挽巷 2020-12-18 09:38

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

2条回答
  •  庸人自扰
    2020-12-18 10:38

    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.

提交回复
热议问题