如何在启动其中一个函数之前显示自定义向导(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]
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;
我尝试使用PageId wpInstalling
,wpInfoAfter
和wpFinished
,但所有这些都是在驱动程序安装完成后显示的。我需要在安装第二个程序后出现此窗口,但在开始安装驱动程序之前。
安装前的最后一页是“选择其他任务”,因此请使用wpSelectTasks
获取AfterID
的CreateCustomPage
参数:
WelcomePage := CreateCustomPage(wpSelectTasks, '', '');
(如果“选择附加任务”实际显示与否则无关紧要)