NightW0lf SampronЦитата: А возможно в этом новом ProgressBar'e сделать так что бы одновременно запускался ProgressBar и Splash.bmp
[more=Возможно.]
Код: [Setup]
AppName=My Program
AppVerName=My Program version 1.5
DefaultDirName={pf}\My Program
DisableProgramGroupPage=yes
WindowVisible=no
[Files]
Source: Files\*.*; DestDir: {app}; Flags: ignoreversion
Source: WizModernSmallImage.bmp; Flags: dontcopy
Source: splash.bmp; Flags: dontcopy
[Code]
function GetSystemMetrics(nIndex:Integer):Integer;
external 'GetSystemMetrics@user32.dll stdcall';
function InitializeSetup(): Boolean;
var
Form, Splash: TSetupForm;
ProgressBar: TNewProgressBar;
CancelButton: TButton;
StaticText: TNewStaticText;
BitmapImage, BitmapImage1: TBitmapImage;
BitmapFileName: String;
i: Integer;
begin
Form := CreateCustomForm();
try
with Form do
begin
ClientWidth := ScaleX(380);
ClientHeight := ScaleY(120);
BorderStyle:= bsDialog;
Left:= GetSystemMetrics(16) - ClientWidth - ScaleX(12);
Top:= GetSystemMetrics(17) - ClientHeight - ScaleY(12);
end;
BitmapFileName := ExpandConstant('{tmp}\WizModernSmallImage.bmp');
ExtractTemporaryFile(ExtractFileName(BitmapFileName));
BitmapImage := TBitmapImage.Create(Form);
BitmapImage.Left := ScaleX(8);
BitmapImage.Top := ScaleY(8);
BitmapImage.AutoSize := True;
BitmapImage.Bitmap.LoadFromFile(BitmapFileName);
BitmapImage.Parent := Form;
StaticText := TNewStaticText.Create(Form);
StaticText.Top := BitmapImage.Top;
StaticText.Left := BitmapImage.Left + BitmapImage.Width + ScaleX(8)
StaticText.Caption := 'Inno Setup is a free installer for Windows programs.' +
+ #10#13 + 'Support for all versions of Windows in use today';
StaticText.AutoSize := True;
StaticText.Parent := Form;
CancelButton := TButton.Create(Form);
CancelButton.Parent := Form;
CancelButton.Width := ScaleX(75);
CancelButton.Height := ScaleY(23);
CancelButton.Left := Form.ClientWidth - ScaleX(75 + 10);
CancelButton.Top := Form.ClientHeight - ScaleY(23 + 10);
CancelButton.Caption := 'Cancel';
CancelButton.ModalResult := mrCancel;
CancelButton.Cancel := True;
ProgressBar := TNewProgressBar.Create(Form);
with ProgressBar do
begin
Height := CancelButton.Height - ScaleY(8);
Width := Form.Width - ScaleX(128);
Top := CancelButton.Top;
Left := BitmapImage.Left;
Parent := Form;
Min:= 0;
Max:= 30;
Position := 0;
end;
Form.ActiveControl := CancelButton;
Form.Show();
Splash := CreateCustomForm;
Splash.BorderStyle := bsNone;
BitmapImage1 := TBitmapImage.Create(Splash);
with BitmapImage1 do begin
AutoSize := True;
Align := alClient;
Left := 0;
Top := 0;
Stretch := True;
Parent := Splash;
end;
ExtractTemporaryFile('Splash.bmp');
BitmapImage1.Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\Splash.bmp');
Splash.Width := BitmapImage1.Width;
Splash.Height := BitmapImage1.Height;
Splash.Center;
Splash.Show;
BitmapImage1.Refresh;
for i:= 0 to 30 do
begin
ProgressBar.Position:= i;
Form.Repaint;
Sleep(500);
i:= i + 1;
end;
finally
Form.Free();
Splash.Free();
end;
Result:= True;
end;