How can I show a "please wait" window while checking for prerequisites in my installer?
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 butt开发者_Python百科on 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;
精彩评论