我如何显示“请稍候"?窗口,同时在安装程序中检查先决条件? [英] How can I show a "please wait" window while checking for prerequisites in my installer?

查看:78
本文介绍了我如何显示“请稍候"?窗口,同时在安装程序中检查先决条件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在脚本的InitializeSetup函数中进行了许多检查.这些过程大约需要10秒钟才能完成,在此期间,除了任务栏上的窗口按钮外,什么都没有显示(单击它不会产生任何结果).我想显示一个简单的请稍候"窗口.我该怎么办?

I do a number of checks in the InitializeSetup function in my script. These take about 10 seconds to complete, during which time nothing is displayed except for the window button on the taskbar (clicking it yields nothing). I would like to show a simple "Please wait" window instead. How can I do this?

推荐答案

以下是示例脚本,显示了如何创建自定义对话框.

Here is sample script that shows how you can create a custom dialog.

基本上创建一个自定义窗体并将自定义控件放在其上.您可以以此为起点,使对话框如您所愿地显示.

Basically create a custom form and place the custom control on it. You can use this as starting point to get the dialog appear as you wish.

[Setup]
AppName='Test Date Script'
AppVerName='Test Date Script'
DefaultDirName={pf}\test

[Code]

function InitializeSetup() : boolean;
var
  DlgWait : TSetupForm;
  lblWait : TLabel;
  I : Integer;
begin
  dlgWait :=  CreateCustomForm;
  dlgWait.FormStyle := bsDialog;
  dlgWait.Position := poMainFormCenter;
  lblWait := TLabel.Create(dlgWait);
  lblWait.Parent := dlgWait;
  lblWait.Caption := 'Please Wait';
  lblWait.Visible := True;
  dlgWait.Show;
  dlgWait.Refresh; // Process the paint message

  for I := 0 to 10 do
  begin
     Sleep(1000); // Simulate Functions taking 10 sec
     dlgWait.Refresh;
  end;

  DlgWait.Free;
end;

这篇关于我如何显示“请稍候"?窗口,同时在安装程序中检查先决条件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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