How can I show a “please wait” window while checki

2019-06-08 17:45发布

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?

标签: inno-setup
1条回答
姐就是有狂的资本
2楼-- · 2019-06-08 18:01

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;
查看更多
登录 后发表回答