Vadim Pavlovich
Vadim Pavlovich

Reputation: 161

Inno Setup: Show custom page before installation starts

How to display a custom wizard before starting one of the functions (Task - printer):

[Run]
Filename: "{tmp}\First.exe"; WorkingDir: {app}; StatusMsg: First program install; Tasks: fp1;
Filename: "{tmp}\Second.exe"; WorkingDir: {app}; StatusMsg: Second program install; Tasks: fp2;
Filename: "{tmp}\Drivers\Install.exe"; WorkingDir: {app}; StatusMsg: Drivers install; Tasks: printer; 

Code section:

[Code]

procedure InitializeWizard;
var
  BitmapFileName: string;
  BitmapImage: TBitmapImage;
  WelcomePage: TWizardPage;
begin
  WelcomePage := CreateCustomPage(wpInstalling, '', '');    

  BitmapFileName := ExpandConstant('{tmp}\image.bmp');
  ExtractTemporaryFile(ExtractFileName(BitmapFileName));

  BitmapImage := TBitmapImage.Create(WelcomePage);
  BitmapImage.AutoSize := True;
  BitmapImage.Bitmap.LoadFromFile(BitmapFileName);
  BitmapImage.Cursor := crHand;
  BitmapImage.Left := 10;
  BitmapImage.Top := 10;
  BitmapImage.Parent := WelcomePage.Surface;
end;

I try to use as PageId wpInstalling, wpInfoAfter, and wpFinished but all of them are show after drivers install completed. And I need this window to appear after installing the second program, but before starting to install the driver.

Upvotes: 1

Views: 995

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202118

The last page before installation is the "Select Additional Tasks", so use wpSelectTasks for AfterID parameter of CreateCustomPage:

WelcomePage := CreateCustomPage(wpSelectTasks, '', '');   

(it does not matter if the "Select Additional Tasks" actually displays or not)

Upvotes: 1

Related Questions