如何跳过所有向导页面并直接进入安装过程? [英] How to skip all the wizard pages and go directly to the installation process?

查看:79
本文介绍了如何跳过所有向导页面并直接进入安装过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我在安装程序中使用了3个向导页面(准备安装安装完成页面).

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

我想使过程尽可能简单,所以我希望将其减少到只有2页(安装完成页).

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 ?

推荐答案

正确的方法是通过以下指令禁用所有页面:

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.

这篇关于如何跳过所有向导页面并直接进入安装过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆