1

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.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Vadim Pavlovich
  • 161
  • 2
  • 11
  • I've posted a new answer. The previous one was completely wrong. For some reason I believed that the first argument of `CreateCustomPage` is "Before ID", while it is actually "After ID". – Martin Prikryl Mar 22 '19 at 07:47

1 Answers1

1

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)

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992