moderninno.iss 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. [Code]
  2. { from https://stackoverflow.com/questions/11778292/how-to-change-wizard-size-width-and-height-in-an-inno-setup-installer }
  3. procedure ShiftDown(Control: TControl; DeltaY: Integer);
  4. begin
  5. Control.Top := Control.Top + DeltaY;
  6. end;
  7. procedure ShiftRight(Control: TControl; DeltaX: Integer);
  8. begin
  9. Control.Left := Control.Left + DeltaX;
  10. end;
  11. procedure ShiftDownAndRight(Control: TControl; DeltaX, DeltaY: Integer);
  12. begin
  13. ShiftDown(Control, DeltaY);
  14. ShiftRight(Control, DeltaX);
  15. end;
  16. procedure GrowDown(Control: TControl; DeltaY: Integer);
  17. begin
  18. Control.Height := Control.Height + DeltaY;
  19. end;
  20. procedure GrowRight(Control: TControl; DeltaX: Integer);
  21. begin
  22. Control.Width := Control.Width + DeltaX;
  23. end;
  24. procedure GrowRightAndDown(Control: TControl; DeltaX, DeltaY: Integer);
  25. begin
  26. GrowRight(Control, DeltaX);
  27. GrowDown(Control, DeltaY);
  28. end;
  29. procedure GrowRightAndShiftDown(Control: TControl; DeltaX, DeltaY: Integer);
  30. begin
  31. GrowRight(Control, DeltaX);
  32. ShiftDown(Control, DeltaY);
  33. end;
  34. { inspired by https://stackoverflow.com/questions/11778292/how-to-change-wizard-size-width-and-height-in-an-inno-setup-installer
  35. and https://stackoverflow.com/questions/38684039/display-image-in-top-panel-of-inno-setup-wizard-instead-of-page-title-and-descri
  36. check Projects/Wizard.pas for more items }
  37. procedure InitializeWizard();
  38. var
  39. DeltaY: Integer;
  40. DeltaX: Integer;
  41. begin
  42. with WizardForm do
  43. begin
  44. DeltaX := ScaleX(WizardSmallBitmapImage.Bitmap.Width)-MainPanel.Width;
  45. DeltaY := ScaleY(WizardSmallBitmapImage.Bitmap.Height)-MainPanel.Height;
  46. { Banner }
  47. MainPanel.Width := ScaleX(WizardSmallBitmapImage.Bitmap.Width);
  48. MainPanel.Height := ScaleY(WizardSmallBitmapImage.Bitmap.Height);
  49. WizardSmallBitmapImage.Top := 0;
  50. WizardSmallBitmapImage.Left := 0;
  51. WizardSmallBitmapImage.Width := MainPanel.Width;
  52. WizardSmallBitmapImage.Height := MainPanel.Height;
  53. WizardSmallBitmapImage.Stretch := True;
  54. WizardSmallBitmapImage.AutoSize := False;
  55. PageDescriptionLabel.Visible := False;
  56. PageNameLabel.Visible := False;
  57. Bevel1.Visible := False;
  58. { Frame }
  59. GrowRightAndDown(WizardForm, DeltaX, DeltaY);
  60. { General Controls }
  61. GrowRightAndShiftDown(Bevel, DeltaX, DeltaY);
  62. ShiftDownAndRight(CancelButton, DeltaX, DeltaY);
  63. ShiftDownAndRight(NextButton, DeltaX, DeltaY);
  64. ShiftDownAndRight(BackButton, DeltaX, DeltaY);
  65. GrowRightAndDown(OuterNotebook, DeltaX, DeltaY);
  66. GrowRight(BeveledLabel, DeltaX);
  67. { InnerPage }
  68. GrowRightAndDown(InnerNotebook, DeltaX, DeltaY);
  69. { WelcomePage }
  70. WelcomeLabel2.Top := WelcomeLabel2.Top+MainPanel.Height;
  71. WelcomeLabel2.Left := ScaleX(20);
  72. WelcomeLabel2.Width := MainPanel.Width-ScaleX(20);
  73. WelcomeLabel1.Top := WelcomeLabel1.Top+MainPanel.Height;
  74. WelcomeLabel1.Left := ScaleX(10);
  75. WelcomeLabel1.Width := MainPanel.Width-ScaleX(10);
  76. WizardBitmapImage.Bitmap := WizardSmallBitmapImage.Bitmap;
  77. WizardBitmapImage.Width := MainPanel.Width;
  78. WizardBitmapImage.Height := MainPanel.Height;
  79. { LicensePage }
  80. ShiftDown(LicenseNotAcceptedRadio, DeltaY);
  81. ShiftDown(LicenseAcceptedRadio, DeltaY);
  82. GrowRightAndShiftDown(LicenseMemo, DeltaX, DeltaY);
  83. GrowRightAndShiftDown(LicenseLabel1, DeltaX, DeltaY);
  84. { SelectDirPage }
  85. GrowRightAndShiftDown(DiskSpaceLabel, DeltaX, DeltaY);
  86. ShiftDownAndRight(DirBrowseButton, DeltaX, DeltaY);
  87. GrowRightAndShiftDown(DirEdit, DeltaX, DeltaY);
  88. GrowRightAndShiftDown(SelectDirBrowseLabel, DeltaX, DeltaY);
  89. GrowRightAndShiftDown(SelectDirLabel, DeltaX, DeltaY);
  90. { SelectComponentsPage }
  91. GrowRightAndShiftDown(ComponentsDiskSpaceLabel, DeltaX, DeltaY);
  92. GrowRightAndShiftDown(ComponentsList, DeltaX, DeltaY);
  93. GrowRightAndShiftDown(TypesCombo, DeltaX, DeltaY);
  94. GrowRightAndShiftDown(SelectComponentsLabel, DeltaX, DeltaY);
  95. { SelectTasksPage }
  96. GrowRightAndShiftDown(TasksList, DeltaX, DeltaY);
  97. GrowRightAndShiftDown(SelectTasksLabel, DeltaX, DeltaY);
  98. { ReadyPage }
  99. GrowRightAndShiftDown(ReadyMemo, DeltaX, DeltaY);
  100. GrowRightAndShiftDown(ReadyLabel, DeltaX, DeltaY);
  101. { PreparingPage }
  102. ShiftDown(PreparingYesRadio, DeltaY);
  103. ShiftDown(PreparingNoRadio, DeltaY);
  104. GrowRightAndShiftDown(PreparingLabel, DeltaX, DeltaY);
  105. GrowRightAndShiftDown(PreparingMemo, DeltaX, DeltaY);
  106. { InstallingPage }
  107. GrowRightAndShiftDown(FilenameLabel, DeltaX, DeltaY);
  108. GrowRightAndShiftDown(StatusLabel, DeltaX, DeltaY);
  109. GrowRightAndShiftDown(ProgressGauge, DeltaX, DeltaY);
  110. { FinishedPage }
  111. FinishedLabel.Top := FinishedLabel.Top+MainPanel.Height;
  112. FinishedLabel.Left := ScaleX(20);
  113. FinishedLabel.Width := MainPanel.Width-ScaleX(20);
  114. FinishedHeadingLabel.Top := FinishedHeadingLabel.Top+MainPanel.Height;
  115. FinishedHeadingLabel.Left := ScaleX(10);
  116. FinishedHeadingLabel.Width := MainPanel.Width-ScaleX(10);
  117. WizardBitmapImage2.Bitmap := WizardSmallBitmapImage.Bitmap;
  118. WizardBitmapImage2.Width := MainPanel.Width;
  119. WizardBitmapImage2.Height := MainPanel.Height;
  120. end;
  121. end;
  122. procedure CurPageChanged(CurPageID: Integer);
  123. begin
  124. if CurPageID = wpSelectTasks then
  125. WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall);
  126. end;