Advertisement
Guest User

Untitled

a guest
Sep 8th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Welcome image
  2.  
  3. var
  4.   WelcomeBitmap: TBitmapImage;
  5.  
  6.  
  7. procedure CurPageChanged(CurPageId: Integer);
  8. begin
  9.   if CurPageId = wpWelcome then begin
  10.     WizardForm.WelcomeLabel1.Hide;
  11.     WizardForm.WelcomeLabel2.Hide;
  12.   end;
  13. end;  
  14.  
  15.  
  16. procedure InitializeWizard();
  17. var
  18.   res: Integer;
  19.   ix, iy: Integer;
  20. begin
  21.   WelcomeBitmap:= TBitmapImage.Create(WizardForm.WelcomePage);
  22.   with WelcomeBitmap do
  23.   begin
  24.     ix := -100 + (ScaleX(50));
  25.     if ix > 0 then iy := 0;
  26.     Left     := ix;
  27.     iy := -100 + (ScaleY(50));
  28.     if iy > 0 then iy := 0;
  29.     Top      := iy;
  30.     Width    := WizardForm.WelcomePage.ClientWidth - ix;
  31.     Height   := ScaleY(315) - iy;
  32.     Parent := WizardForm.WelcomePage;
  33.   end;
  34.   with TLabel.Create(WizardForm.WelcomePage) do begin
  35.     Left := 3;
  36.     Parent := WizardForm.NextButton.Parent;
  37.     Top := WizardForm.Bevel.Top + WizardForm.Bevel.Height + 2;
  38.     Caption := '{#VERSION_STRING}';
  39.   end;
  40.   WizardForm.WizardSmallBitmapImage.Left := WizardForm.WizardSmallBitmapImage.Left - 5;
  41.   WizardForm.WizardSmallBitmapImage.ReplaceColor := clWhite;
  42.   WizardForm.WizardSmallBitmapImage.ReplaceWithColor := clWindow;
  43.   ExtractTemporaryFile('oxygene_setup_welcome.bmp');
  44.   WelcomeBitmap.Bitmap.LoadFromFile( ExpandConstant( '{tmp}\oxygene_setup_welcome.bmp' ) );
  45. end;
  46.  
  47. /// Preq
  48.  
  49.  
  50. var
  51.   prereqpanel: TPanel;
  52.   prereqimage: TBitmapImage;
  53.  
  54. procedure ShowPrereq(ImageName: string);
  55. var
  56.   ix, iy: Integer;
  57.   ctrl: TWinControl;
  58. begin
  59.   if assigned(prereqimage) then prereqimage.Free;
  60.   if assigned(prereqpanel) then prereqpanel.Free;
  61.   prereqimage := nil;
  62.   prereqpanel := nil;
  63.  
  64.   if ImageName = '' then exit;
  65.   ctrl := WizardForm.PreparingPage.Parent.Parent;
  66.   prereqpanel := TPanel.Create(ctrl);
  67.   with prereqpanel do begin
  68.     left := 0;
  69.     top := 0;
  70.     width := ctrl.Width;
  71.     height := ctrl.Height;
  72.     parent := ctrl;
  73.   end;
  74.  
  75.   prereqimage:= TBitmapImage.Create(ctrl);
  76.   with prereqimage do
  77.   begin
  78.     ix := -100 + (ScaleX(50));
  79.     if ix > 0 then iy := 0;
  80.     Left     := ix;
  81.     iy := -100 + (ScaleY(50));
  82.     if iy > 0 then iy := 0;
  83.     Top      := iy;
  84.     Width    := ctrl.ClientWidth - ix;
  85.     Height   := ScaleY(315) - iy;
  86.     Parent := prereqpanel;
  87.   end;
  88.  
  89.   ExtractTemporaryFile(ImageName);
  90.   prereqimage.Bitmap.LoadFromFile( ExpandConstant( '{tmp}\'+ImageName) );
  91. end;
  92.  
  93. function DetectAndInstallPrerequisites: Boolean;
  94.   (*** Place your prerequisite detection and installation code below. ***)
  95.   (*** Return False if missing prerequisites were detected but their installation failed, else return True. ***)
  96. var
  97.   lDummy: Integer;
  98. begin
  99.   Result := True;
  100.   ShowPrereq('oxygene_setup_installing_VS2010.bmp');
  101.   if GetNeedsShell and not InstallShell then begin
  102.     ShowPrereq('');
  103.     MsgBox(ExpandConstant('{cm:ShellInstallFailed}'), mbInformation, MB_OK);
  104.     ShellFailed := true;
  105.     result := false;
  106.   end;
  107.   ShowPrereq('');
  108. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement