I am trying to create a splash screen for my installer in Inno Setup. I create a form that is displayed for 2 seconds at the beginning of the installer, but the image is not displayed in it.
Only when I use the ShowModal
function is it displayed, but it does not close after 2 seconds.
Here is my code:
[Code]
var
SplashForm: TSetupForm;
BIRegistry: TBitmapImage;
procedure SplashScreen;
begin
SplashForm := CreateCustomForm;
SplashForm.Position := poScreenCenter;
SplashForm.BorderStyle := bsNone;
BIRegistry := TBitmapImage.Create(SplashForm);
BIRegistry.Bitmap.LoadFromFile(ExpandConstant('{tmp}\regtoexe.bmp'));
BIRegistry.Parent := SplashForm;
BIRegistry.AutoSize := True;
SplashForm.ClientHeight := BIRegistry.Height;
SplashForm.ClientWidth := BIRegistry.Width;
SplashForm.Show;
Sleep(2000);
SplashForm.Close;
end;
procedure InitializeWizard;
begin
ExtractTemporaryFile('regtoexe.bmp');
SplashScreen;
What's wrong with this code?