Преглед изворни кода

Merge branch 'anchors' into is-6

Martijn Laan пре 6 година
родитељ
комит
bed2dbdff6
59 измењених фајлова са 786 додато и 163 уклоњено
  1. 14 3
      Components/BidiUtils.pas
  2. 1 0
      Components/BitmapImage.pas
  3. 3 1
      Components/FolderTreeView.pas
  4. 1 0
      Components/NewCheckListBox.pas
  5. 1 0
      Components/NewNotebook.pas
  6. 3 5
      Components/NewProgressBar.pas
  7. 1 0
      Components/NewStaticText.pas
  8. 3 4
      Components/PasswordEdit.pas
  9. 2 0
      Components/ScintStylerInnoSetup.pas
  10. 1 1
      Components/UniPs
  11. 1 0
      Examples/64Bit.iss
  12. 1 0
      Examples/64BitThreeArch.iss
  13. 1 0
      Examples/64BitTwoArch.iss
  14. 1 0
      Examples/CodeAutomation.iss
  15. 1 0
      Examples/CodeAutomation2.iss
  16. 41 8
      Examples/CodeClasses.iss
  17. 1 0
      Examples/CodeDlg.iss
  18. 1 0
      Examples/CodeDll.iss
  19. 1 0
      Examples/CodeExample1.iss
  20. 1 0
      Examples/CodePrepareToInstall.iss
  21. 1 0
      Examples/Components.iss
  22. 1 0
      Examples/Example1.iss
  23. 1 0
      Examples/Example2.iss
  24. 1 0
      Examples/Example3.iss
  25. 1 0
      Examples/ISPPExample1.iss
  26. 1 0
      Examples/Languages.iss
  27. 1 0
      Examples/UnicodeExample1.iss
  28. 1 0
      Examples/UninstallCodeExample1.iss
  29. 35 5
      ISHelp/isetup.xml
  30. 32 5
      ISHelp/isxclasses.pas
  31. 24 10
      Projects/CompSignTools.dfm
  32. 17 0
      Projects/CompSignTools.pas
  33. 1 0
      Projects/CompWizard.dfm
  34. 2 9
      Projects/CompWizard.pas
  35. 42 3
      Projects/Compile.pas
  36. 2 1
      Projects/Install.pas
  37. 1 1
      Projects/Main.pas
  38. 11 0
      Projects/NewDisk.dfm
  39. 5 6
      Projects/NewDisk.pas
  40. 15 2
      Projects/ScriptClasses_C.pas
  41. 11 2
      Projects/ScriptClasses_R.pas
  42. 1 1
      Projects/ScriptDlg.pas
  43. 11 0
      Projects/SelFolderForm.dfm
  44. 2 1
      Projects/SelFolderForm.pas
  45. 58 28
      Projects/SelLangForm.dfm
  46. 12 5
      Projects/SelLangForm.pas
  47. 105 15
      Projects/SetupForm.pas
  48. 5 1
      Projects/Struct.pas
  49. 1 1
      Projects/Undo.pas
  50. 28 0
      Projects/UninstProgressForm.dfm
  51. 8 6
      Projects/UninstProgressForm.pas
  52. 13 0
      Projects/UninstSharedFileForm.dfm
  53. 2 1
      Projects/UninstSharedFileForm.pas
  54. 1 1
      Projects/Uninstall.pas
  55. 118 1
      Projects/Wizard.dfm
  56. 101 15
      Projects/Wizard.pas
  57. 16 21
      license.txt
  58. 1 0
      setup.iss
  59. 17 0
      whatsnew.htm

+ 14 - 3
Components/BidiUtils.pas

@@ -2,13 +2,11 @@ unit BidiUtils;
 
 {
   Inno Setup
-  Copyright (C) 1997-2007 Jordan Russell
+  Copyright (C) 1997-2018 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
   Bidi utility functions
-
-  $jrsoftware: issrc/Components/BidiUtils.pas,v 1.2 2007/11/27 04:52:53 jr Exp $
 }
 
 interface
@@ -63,6 +61,9 @@ begin
     AParams.ExStyle := AParams.ExStyle or (WS_EX_RTLREADING or WS_EX_LEFTSCROLLBAR or WS_EX_RIGHT);
 end;
 
+type
+  TControlAccess = class(TControl);
+
 procedure FlipControls(const AParentCtl: TWinControl);
 var
   ParentWidth, I: Integer;
@@ -75,6 +76,16 @@ begin
     ParentWidth := AParentCtl.ClientWidth;
     for I := 0 to AParentCtl.ControlCount-1 do begin
       Ctl := AParentCtl.Controls[I];
+      if (akLeft in Ctl.Anchors) and not (akRight in Ctl.Anchors) then
+        Ctl.Anchors := Ctl.Anchors - [akLeft] + [akRight]
+      else if not (akLeft in Ctl.Anchors) and (akRight in Ctl.Anchors) then begin
+        { Before we can set Anchors to [akLeft, akTop] (which has a special
+          'no anchors' meaning to VCL), we first need to update the Explicit*
+          properties so the control doesn't get moved back to an old position. }
+        if Ctl.Anchors = [akTop, akRight] then
+          TControlAccess(Ctl).UpdateExplicitBounds;
+        Ctl.Anchors := Ctl.Anchors - [akRight] + [akLeft];
+      end;
       Ctl.Left := ParentWidth - Ctl.Width - Ctl.Left;
     end;
   finally

+ 1 - 0
Components/BitmapImage.pas

@@ -43,6 +43,7 @@ type
     destructor Destroy; override;
   published
     property Align;
+    property Anchors;
     property AutoSize: Boolean read FAutoSize write SetAutoSize default False;
     property BackColor: TColor read FBackColor write SetBackColor default clBtnFace;
     property Center: Boolean read FCenter write SetCenter default False;

+ 3 - 1
Components/FolderTreeView.pas

@@ -2,7 +2,7 @@ unit FolderTreeView;
 
 {
   Inno Setup
-  Copyright (C) 1997-2015 Jordan Russell
+  Copyright (C) 1997-2018 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
@@ -74,6 +74,7 @@ type
     function GetItemImageIndex(const Item: HTREEITEM;
       const NewItem, SelectedImage: Boolean): Integer; override;
   published
+    property Anchors;
     property TabOrder;
     property TabStop default True;
     property Visible;
@@ -97,6 +98,7 @@ type
     procedure SetPaths(const AUserPrograms, ACommonPrograms,
       AUserStartup, ACommonStartup: String);
   published
+    property Anchors;
     property TabOrder;
     property TabStop default True;
     property Visible;

+ 1 - 0
Components/NewCheckListBox.pas

@@ -153,6 +153,7 @@ type
     property State[Index: Integer]: TCheckBoxState read GetState;
   published
     property Align;
+    property Anchors;
     property BorderStyle;
     property Color;
     property Ctl3D;

+ 1 - 0
Components/NewNotebook.pas

@@ -40,6 +40,7 @@ type
   published
     property ActivePage: TNewNotebookPage read FActivePage write SetActivePage;
     property Align;
+    property Anchors;
     property Color;
     property DragCursor;
     property DragMode;

+ 3 - 5
Components/NewProgressBar.pas

@@ -2,19 +2,16 @@ unit NewProgressBar;
 
 {
   Inno Setup
-  Copyright (C) 1997-2006 Jordan Russell
+  Copyright (C) 1997-2018 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
-  TNewProgressBar component - a smooth TProgressBar for Delphi 2 and a 32 bit
-  TProgressBar for Delphi 2 and all platforms
+  TNewProgressBar component - a smooth 32 bit TProgressBar
 
   Note: themed Vista and newer animate progress bars and don't immediately show changes.
   This applies both to Position and State. For example if you set State while the
   progress bar is still moving towards a new Position, the new State doesnt show until
   the moving animation has finished.
-
-  $jrsoftware: issrc/Components/NewProgressBar.pas,v 1.10 2010/10/27 09:45:06 mlaan Exp $
 }
 
 interface
@@ -46,6 +43,7 @@ type
   public
     constructor Create(AOwner: TComponent); override;
   published
+    property Anchors;
     property Min: LongInt read FMin write SetMin;
     property Max: LongInt read FMax write SetMax;
     property Position: LongInt read FPosition write SetPosition default 0;

+ 1 - 0
Components/NewStaticText.pas

@@ -50,6 +50,7 @@ type
     function AdjustHeight: Integer;
   published
     property Align;
+    property Anchors;
     property AutoSize: Boolean read FAutoSize write SetAutoSize default True;
     property Caption;
     property Color;

+ 3 - 4
Components/PasswordEdit.pas

@@ -2,13 +2,11 @@ unit PasswordEdit;
 
 {
   Inno Setup
-  Copyright (C) 1997-2007 Jordan Russell
+  Copyright (C) 1997-2018 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
-  This unit provides a true password edit for Delphi 2.
-
-  $jrsoftware: issrc/Components/PasswordEdit.pas,v 1.3 2007/12/10 18:28:53 jr Exp $
+  This unit provides a true password edit.
 }
 
 interface
@@ -26,6 +24,7 @@ type
   public
     constructor Create(AOwner: TComponent); override;
   published
+    property Anchors;
     property AutoSelect;
     property AutoSize;
     property BorderStyle;

+ 2 - 0
Components/ScintStylerInnoSetup.pas

@@ -258,8 +258,10 @@ type
     ssWizardImageBackColor,
     ssWizardImageFile,
     ssWizardImageStretch,
+    ssWizardResizable,
     ssWizardSmallImageBackColor,
     ssWizardSmallImageFile,
+    ssWizardSizePercent,
     ssWizardStyle);
 
   TLangOptionsSectionDirective = (

+ 1 - 1
Components/UniPs

@@ -1 +1 @@
-Subproject commit 86b5b61f6542e6e5109ac65ef88fd1689ae8dbf7
+Subproject commit 3ee6af752a1cb74f1d2b483bd97d3296175b4951

+ 1 - 0
Examples/64Bit.iss

@@ -9,6 +9,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DefaultDirName={autopf}\My Program
 DefaultGroupName=My Program
 UninstallDisplayIcon={app}\MyProg.exe

+ 1 - 0
Examples/64BitThreeArch.iss

@@ -7,6 +7,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DefaultDirName={autopf}\My Program
 DefaultGroupName=My Program
 UninstallDisplayIcon={app}\MyProg.exe

+ 1 - 0
Examples/64BitTwoArch.iss

@@ -13,6 +13,7 @@ AppVersion=1.5
 DefaultDirName={autopf}\My Program
 DefaultGroupName=My Program
 UninstallDisplayIcon={app}\MyProg.exe
+WizardStyle=modern
 Compression=lzma2
 SolidCompression=yes
 OutputDir=userdocs:Inno Setup Examples Output

+ 1 - 0
Examples/CodeAutomation.iss

@@ -5,6 +5,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DisableWelcomePage=no
 CreateAppDir=no
 DisableProgramGroupPage=yes

+ 1 - 0
Examples/CodeAutomation2.iss

@@ -10,6 +10,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DisableWelcomePage=no
 CreateAppDir=no
 DisableProgramGroupPage=yes

+ 41 - 8
Examples/CodeClasses.iss

@@ -5,11 +5,18 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 CreateAppDir=no
 DisableProgramGroupPage=yes
 DefaultGroupName=My Program
 UninstallDisplayIcon={app}\MyProg.exe
 OutputDir=userdocs:Inno Setup Examples Output
+PrivilegesRequired=lowest
+
+; Uncomment the following three lines to test the layout when scaling and rtl are active
+;[LangOptions]
+;RightToLeft=yes
+;DialogFontSize=12
 
 [Files]
 Source: compiler:WizModernSmallImage.bmp; Flags: dontcopy
@@ -36,37 +43,43 @@ begin
     Form.ClientWidth := ScaleX(256);
     Form.ClientHeight := ScaleY(128);
     Form.Caption := 'TSetupForm';
-    Form.CenterInsideControl(WizardForm, False);
 
     Edit := TNewEdit.Create(Form);
     Edit.Top := ScaleY(10);
     Edit.Left := ScaleX(10);
     Edit.Width := Form.ClientWidth - ScaleX(2 * 10);
     Edit.Height := ScaleY(23);
+    Edit.Anchors := [akLeft, akTop, akRight];
     Edit.Text := 'TNewEdit';
     Edit.Parent := Form;
 
     OKButton := TNewButton.Create(Form);
     OKButton.Parent := Form;
-    OKButton.Width := ScaleX(75);
-    OKButton.Height := ScaleY(23);
     OKButton.Left := Form.ClientWidth - ScaleX(75 + 6 + 75 + 10);
     OKButton.Top := Form.ClientHeight - ScaleY(23 + 10);
+    OKButton.Width := ScaleX(75);
+    OKButton.Height := ScaleY(23);
+    OKButton.Anchors := [akRight, akBottom]
     OKButton.Caption := 'OK';
     OKButton.ModalResult := mrOk;
     OKButton.Default := True;
 
     CancelButton := TNewButton.Create(Form);
     CancelButton.Parent := Form;
-    CancelButton.Width := ScaleX(75);
-    CancelButton.Height := ScaleY(23);
     CancelButton.Left := Form.ClientWidth - ScaleX(75 + 10);
     CancelButton.Top := Form.ClientHeight - ScaleY(23 + 10);
+    CancelButton.Width := ScaleX(75);
+    CancelButton.Height := ScaleY(23);
+    CancelButton.Anchors := [akRight, akBottom]
     CancelButton.Caption := 'Cancel';
     CancelButton.ModalResult := mrCancel;
     CancelButton.Cancel := True;
 
     Form.ActiveControl := Edit;
+    { Keep the form from sizing vertically since we don't have any controls which can size vertically }
+    Form.KeepSizeY := True;
+    { Center on WizardForm. Without this call it will still automatically center, but on the screen }
+    Form.FlipSizeAndCenterIfNeeded(True, WizardForm, False);
 
     if Form.ShowModal() = mrOk then
       MsgBox('You clicked OK.', mbInformation, MB_OK);
@@ -77,7 +90,8 @@ end;
 
 procedure TaskDialogButtonOnClick(Sender: TObject);
 begin
-  //TaskDialogMsgBox isn't a class but showing it anyway since it fits with the theme
+  { TaskDialogMsgBox isn't a class but showing it anyway since it fits with the theme }
+
   case TaskDialogMsgBox('Choose A or B',
                         'You can choose A or B.', 'You can choose A or B'#13#10#13#10'Do you choose A?',   
                         mbInformation,
@@ -122,6 +136,7 @@ begin
   Panel.Width := Page.SurfaceWidth div 2 - ScaleX(8);
   Panel.Left :=  Page.SurfaceWidth - Panel.Width;
   Panel.Height := Button.Height * 2;
+  Panel.Anchors := [akLeft, akTop, akRight];
   Panel.Caption := 'TPanel';
   Panel.Color := clWindow;
   Panel.BevelKind := bkFlat;
@@ -147,6 +162,7 @@ begin
   PasswordEdit.Left := Page.SurfaceWidth - Edit.Width;
   PasswordEdit.Top := CheckBox.Top + CheckBox.Height + ScaleY(8);
   PasswordEdit.Width := Edit.Width;
+  PasswordEdit.Anchors := [akLeft, akTop, akRight];
   PasswordEdit.Text := 'TPasswordEdit';
   PasswordEdit.Parent := Page.Surface;
 
@@ -154,6 +170,7 @@ begin
   Memo.Top := Edit.Top + Edit.Height + ScaleY(8);
   Memo.Width := Page.SurfaceWidth;
   Memo.Height := ScaleY(89);
+  Memo.Anchors := [akLeft, akTop, akRight, akBottom];
   Memo.ScrollBars := ssVertical;
   Memo.Text := 'TNewMemo';
   Memo.Parent := Page.Surface;
@@ -162,6 +179,7 @@ begin
   FormButton.Top := Memo.Top + Memo.Height + ScaleY(8);
   FormButton.Width := ScaleX(75);
   FormButton.Height := ScaleY(23);
+  FormButton.Anchors := [akLeft, akBottom];
   FormButton.Caption := 'TSetupForm';
   FormButton.OnClick := @FormButtonOnClick;
   FormButton.Parent := Page.Surface;
@@ -171,6 +189,7 @@ begin
   TaskDialogButton.Left := FormButton.Left + FormButton.Width + ScaleX(8);
   TaskDialogButton.Width := ScaleX(110);
   TaskDialogButton.Height := ScaleY(23);
+  TaskDialogButton.Anchors := [akLeft, akBottom];
   TaskDialogButton.Caption := 'TaskDialogMsgBox';
   TaskDialogButton.OnClick := @TaskDialogButtonOnClick;
   TaskDialogButton.Parent := Page.Surface;
@@ -181,6 +200,7 @@ begin
 
   ComboBox := TNewComboBox.Create(Page);
   ComboBox.Width := Page.SurfaceWidth;
+  ComboBox.Anchors := [akLeft, akTop, akRight];
   ComboBox.Parent := Page.Surface;
   ComboBox.Style := csDropDownList;
   ComboBox.Items.Add('TComboBox');
@@ -190,18 +210,21 @@ begin
   ListBox.Top := ComboBox.Top + ComboBox.Height + ScaleY(8);
   ListBox.Width := Page.SurfaceWidth;
   ListBox.Height := ScaleY(97);
+  ListBox.Anchors := [akLeft, akTop, akRight, akBottom];
   ListBox.Parent := Page.Surface;
   ListBox.Items.Add('TListBox');
   ListBox.ItemIndex := 0;
 
   StaticText := TNewStaticText.Create(Page);
   StaticText.Top := ListBox.Top + ListBox.Height + ScaleY(8);
+  StaticText.Anchors := [akLeft, akRight, akBottom];
   StaticText.Caption := 'TNewStaticText';
   StaticText.AutoSize := True;
   StaticText.Parent := Page.Surface;
 
   ProgressBarLabel := TNewStaticText.Create(Page);
   ProgressBarLabel.Top := StaticText.Top + StaticText.Height + ScaleY(8);
+  ProgressBarLabel.Anchors := [akLeft, akBottom];
   ProgressBarLabel.Caption := 'TNewProgressBar';
   ProgressBarLabel.AutoSize := True;
   ProgressBarLabel.Parent := Page.Surface;
@@ -211,6 +234,7 @@ begin
   ProgressBar.Top := ProgressBarLabel.Top;
   ProgressBar.Width := Page.SurfaceWidth - ProgressBar.Left;
   ProgressBar.Height := ProgressBarLabel.Height + ScaleY(8);
+  ProgressBar.Anchors := [akLeft, akRight, akBottom];
   ProgressBar.Parent := Page.Surface;
   ProgressBar.Position := 25;
 
@@ -219,6 +243,7 @@ begin
   ProgressBar2.Top := ProgressBar.Top + ProgressBar.Height + ScaleY(4);
   ProgressBar2.Width := Page.SurfaceWidth - ProgressBar.Left;
   ProgressBar2.Height := ProgressBarLabel.Height + ScaleY(8);
+  ProgressBar2.Anchors := [akLeft, akRight, akBottom];
   ProgressBar2.Parent := Page.Surface;
   ProgressBar2.Position := 50;
   { Note: TNewProgressBar.State property only has an effect on Windows Vista and newer }
@@ -229,6 +254,7 @@ begin
   ProgressBar3.Top := ProgressBar2.Top + ProgressBar2.Height + ScaleY(4);
   ProgressBar3.Width := Page.SurfaceWidth - ProgressBar.Left;
   ProgressBar3.Height := ProgressBarLabel.Height + ScaleY(8);
+  ProgressBar3.Anchors := [akLeft, akRight, akBottom];
   ProgressBar3.Parent := Page.Surface;
   { Note: TNewProgressBar.Style property only has an effect on Windows XP and newer }
   ProgressBar3.Style := npbstMarquee;
@@ -239,7 +265,8 @@ begin
 
   CheckListBox := TNewCheckListBox.Create(Page);
   CheckListBox.Width := Page.SurfaceWidth;
-  CheckListBox.Height := ScaleY(137);
+  CheckListBox.Height := ScaleY(97);
+  CheckListBox.Anchors := [akLeft, akTop, akRight, akBottom];
   CheckListBox.Flat := True;
   CheckListBox.Parent := Page.Surface;
   CheckListBox.AddCheckBox('TNewCheckListBox', '', 0, True, True, False, True, nil);
@@ -254,7 +281,8 @@ begin
   CheckListBox2 := TNewCheckListBox.Create(Page);
   CheckListBox2.Top := CheckListBox.Top + CheckListBox.Height + ScaleY(8);
   CheckListBox2.Width := Page.SurfaceWidth;
-  CheckListBox2.Height := ScaleY(67);
+  CheckListBox2.Height := ScaleY(97);
+  CheckListBox2.Anchors := [akLeft, akRight, akBottom];
   CheckListBox2.BorderStyle := bsNone;
   CheckListBox2.ParentColor := True;
   CheckListBox2.MinItemHeight := WizardForm.TasksList.MinItemHeight;
@@ -272,6 +300,7 @@ begin
   FolderTreeView := TFolderTreeView.Create(Page);
   FolderTreeView.Width := Page.SurfaceWidth;
   FolderTreeView.Height := Page.SurfaceHeight;
+  FolderTreeView.Anchors := [akLeft, akTop, akRight, akBottom];
   FolderTreeView.Parent := Page.Surface;
   FolderTreeView.Directory := ExpandConstant('{src}');
 
@@ -306,6 +335,7 @@ begin
   BitmapImage3.Left := 3*BitmapImage.Width + 20;
   BitmapImage3.Height := 4*BitmapImage.Height;
   BitmapImage3.Width := 4*BitmapImage.Width;
+  BitmapImage3.Anchors := [akLeft, akTop, akRight, akBottom];
   BitmapImage3.Cursor := crHand;
   BitmapImage3.OnClick := @BitmapImageOnClick;
   BitmapImage3.Parent := Page.Surface;
@@ -317,6 +347,7 @@ begin
   RichEditViewer := TRichEditViewer.Create(Page);
   RichEditViewer.Width := Page.SurfaceWidth;
   RichEditViewer.Height := Page.SurfaceHeight;
+  RichEditViewer.Anchors := [akLeft, akTop, akRight, akBottom];
   RichEditViewer.BevelKind := bkFlat;
   RichEditViewer.BorderStyle := bsNone;
   RichEditViewer.Parent := Page.Surface;
@@ -348,6 +379,7 @@ begin
   AboutButton.Top := CancelButton.Top;
   AboutButton.Width := CancelButton.Width;
   AboutButton.Height := CancelButton.Height;
+  AboutButton.Anchors := [akLeft, akBottom];
   AboutButton.Caption := '&About...';
   AboutButton.OnClick := @AboutButtonOnClick;
   AboutButton.Parent := ParentForm;
@@ -362,6 +394,7 @@ begin
   URLLabel.Font.Color := clHotLight
   URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
   URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(20);
+  URLLabel.Anchors := [akLeft, akBottom];
 end;
 
 procedure InitializeWizard();

+ 1 - 0
Examples/CodeDlg.iss

@@ -8,6 +8,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DisableWelcomePage=no
 DefaultDirName={autopf}\My Program
 DisableProgramGroupPage=yes

+ 1 - 0
Examples/CodeDll.iss

@@ -7,6 +7,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DefaultDirName={autopf}\My Program
 DisableProgramGroupPage=yes
 UninstallDisplayIcon={app}\MyProg.exe

+ 1 - 0
Examples/CodeExample1.iss

@@ -5,6 +5,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DisableWelcomePage=no
 DefaultDirName={code:MyConst}\My Program
 DefaultGroupName=My Program

+ 1 - 0
Examples/CodePrepareToInstall.iss

@@ -7,6 +7,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DefaultDirName={autopf}\My Program
 DefaultGroupName=My Program
 UninstallDisplayIcon={app}\MyProg.exe

+ 1 - 0
Examples/Components.iss

@@ -6,6 +6,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DefaultDirName={autopf}\My Program
 DefaultGroupName=My Program
 UninstallDisplayIcon={app}\MyProg.exe

+ 1 - 0
Examples/Example1.iss

@@ -6,6 +6,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DefaultDirName={autopf}\My Program
 DefaultGroupName=My Program
 UninstallDisplayIcon={app}\MyProg.exe

+ 1 - 0
Examples/Example2.iss

@@ -7,6 +7,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DefaultDirName={autopf}\My Program
 ; Since no icons will be created in "{group}", we don't need the wizard
 ; to ask for a Start Menu folder name:

+ 1 - 0
Examples/Example3.iss

@@ -7,6 +7,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DefaultDirName={autopf}\My Program
 DefaultGroupName=My Program
 UninstallDisplayIcon={app}\MyProg.exe

+ 1 - 0
Examples/ISPPExample1.iss

@@ -21,6 +21,7 @@
 [Setup]
 AppName={#AppName}
 AppVersion={#AppVersion}
+WizardStyle=modern
 DefaultDirName={autopf}\{#AppName}
 DefaultGroupName={#AppName}
 UninstallDisplayIcon={app}\MyProg.exe

+ 1 - 0
Examples/Languages.iss

@@ -7,6 +7,7 @@
 AppName={cm:MyAppName}
 AppId=My Program
 AppVerName={cm:MyAppVerName,1.5}
+WizardStyle=modern
 DefaultDirName={autopf}\{cm:MyAppName}
 DefaultGroupName={cm:MyAppName}
 UninstallDisplayIcon={app}\MyProg.exe

+ 1 - 0
Examples/UnicodeExample1.iss

@@ -6,6 +6,7 @@
 [Setup]
 AppName=ɯɐɹƃoɹd ʎɯ
 AppVerName=ɯɐɹƃoɹd ʎɯ version 1.5
+WizardStyle=modern
 DefaultDirName={autopf}\ɯɐɹƃoɹd ʎɯ
 DefaultGroupName=ɯɐɹƃoɹd ʎɯ
 UninstallDisplayIcon={app}\ƃoɹdʎɯ.exe

+ 1 - 0
Examples/UninstallCodeExample1.iss

@@ -5,6 +5,7 @@
 [Setup]
 AppName=My Program
 AppVersion=1.5
+WizardStyle=modern
 DefaultDirName={autopf}\My Program
 DefaultGroupName=My Program
 UninstallDisplayIcon={app}\MyProg.exe

+ 35 - 5
ISHelp/isetup.xml

@@ -108,7 +108,7 @@ Inno Setup is a <i>free</i> installer for Windows programs by Jordan Russell and
 
 <li>Supports creation of a single EXE to install your program for easy online distribution. <link topic="setup_diskspanning">Disk spanning</link> is also supported.</li>
 
-<li>Standard Windows wizard interface.</li>
+<li>Resizable standard Windows wizard interface.</li>
 
 <li>Customizable setup <link topic="typessection">types</link>, e.g. Full, Minimal, Custom.</li>
 
@@ -1105,6 +1105,8 @@ DefaultGroupName=My Program
 <li><link topic="setup_wizardimagealphaformat">WizardImageAlphaFormat</link></li>
 <li><link topic="setup_wizardimagefile">WizardImageFile</link></li>
 <li><link topic="setup_wizardimagestretch">WizardImageStretch</link></li>
+<li><link topic="setup_wizardresizable">WizardResizable</link></li>
+<li><link topic="setup_wizardsizepercent">WizardSizePercent</link></li>
 <li><link topic="setup_wizardsmallimagefile">WizardSmallImageFile</link></li>
 </ul>
 
@@ -4720,6 +4722,33 @@ DiskSliceSize=1457664
 </body>
 </setuptopic>
 
+<setuptopic directive="WizardResizable">
+<setupvalid><link topic="yesnonotes"><tt>yes</tt> or <tt>no</tt></link></setupvalid>
+<setupdefault><tt>yes</tt> if <link topic="setup_wizardstyle">WizardStyle</link> is set to <tt>modern</tt>, <tt>no</tt> otherwise</setupdefault>
+<body>
+<p>If set to <tt>yes</tt>, the user will be able to resize and maximize the main Setup wizard window.</p>
+<p>Use <tt>Anchors</tt> and <tt>KeepSizeY</tt> properties to add full support for <tt>WizardResizable</tt> and <tt>WizardSizePercent</tt> to all your custom controls, custom wizard pages and <tt>TSetupForm</tt> forms if you have any. See the <i>CodeClasses.iss</i> example script for an example.</p>
+<p><b>See also:</b><br/>
+<link topic="setup_wizardsizepercent">WizardSizePercent</link></p>
+</body>
+</setuptopic>
+
+<setuptopic directive="WizardSizePercent">
+<setupformat><tt><i>a</i>,<i>b</i></tt>, where <tt><i>a</i></tt> is the horizontal size, and <tt><i>b</i></tt> is the vertical size.</setupformat>
+<setupvalid>each size: <tt>100</tt> or more</setupvalid>
+<setupdefault><tt>120,120</tt> if <link topic="setup_wizardstyle">WizardStyle</link> is set to <tt>modern</tt>, <tt>100,100</tt> otherwise</setupdefault>
+<body>
+<p>Lets you increase the default size of all Setup and Uninstall wizard windows without increasing the font size. A size of for example 120 means a 20% size increase.</p>
+<p>If you specify only one size it will be used as both the horizontal and the vertical size.</p>
+<example><pre>WizardSizePercent=120</pre></example>
+<p>Use <tt>Anchors</tt> properties to add full support for <tt>WizardResizable</tt> and <tt>WizardSizePercent</tt> to all your custom controls and wizard pages if you have any. See the <i>CodeClasses.iss</i> example script for an example.</p>
+<p>Note: Some of the wizard windows such as the <i>Select Language</i> dialog will only increase in size horizontally.</p>
+<p><b>See also:</b><br/>
+<link topic="setup_wizardresizable">WizardResizable</link><br/>
+<link topic="langoptionssection" anchor="DialogFontSize">DialogFontSize</link></p>
+</body>
+</setuptopic>
+
 <setuptopic directive="WizardSmallImageBackColor">
 <body>
 <p><i>Obsolete in 5.0.4.</i> This directive formerly specified the background color used to fill any unused space around the small wizard bitmap when <link topic="setup_wizardimagestretch">WizardImageStretch</link> was set to <tt>no</tt>. Now any unused space is filled with the standard window color (usually white). If you wish to create a colored border around the image, do so by modifying the bitmap itself.</p>
@@ -4743,16 +4772,17 @@ DiskSliceSize=1457664
 </setuptopic>
 
 <setuptopic directive="WizardStyle">
-<setupvalid><tt>modern</tt></setupvalid>
-<setupdefault><tt>modern</tt></setupdefault>
+<setupvalid><tt>classic</tt> or <tt>modern</tt></setupvalid>
+<setupdefault><tt>classic</tt></setupdefault>
 <body>
-<p><i>Obsolete in 3.0.</i> Inno Setup 2.x supported an alternate wizard style called "classic". Support for the "classic" style has been dropped in Inno Setup 3.0.</p>
+<p>If this directive is set to <tt>modern</tt>, Setup and Uninstall will show a more modern look and also the defaults for <link topic="setup_wizardresizable">WizardResizable</link> and <link topic="setup_wizardsizepercent">WizardSizePercent</link> change to respectively <tt>yes</tt> and <tt>120,120</tt>.</p>
+<p>Use <tt>Anchors</tt> properties to add full support for <tt>WizardResizable</tt> and <tt>WizardSizePercent</tt> to all your custom controls and wizard pages if you have any. See the <i>CodeClasses.iss</i> example script for an example.</p>
 </body>
 </setuptopic>
 
 <setuptopic directive="UninstallStyle">
 <body>
-<p><i>Obsolete in 5.0.0.</i> Only the "modern" uninstaller style is supported now.</p>
+<p><i>Obsolete in 5.0.0.</i></p>
 </body>
 </setuptopic>
 

+ 32 - 5
ISHelp/isxclasses.pas

@@ -159,6 +159,10 @@ end;
 
 TAlign = (alNone, alTop, alBottom, alLeft, alRight, alClient);
 
+TAnchorKind = (akLeft, akTop, akRight, akBottom);
+
+TAnchors = set of TAnchorKind;
+
 TControl = class(TComponent)
   constructor Create(AOwner: TComponent);
   procedure BringToFront;
@@ -242,6 +246,7 @@ TForm = class(TScrollingWinControl)
   procedure Release;
   property Active: Boolean; read;
   property ActiveControl: TWinControl; read write;
+  property Anchors: TAnchors; read write;
   property BorderIcons: TBorderIcons; read write;
   property BorderStyle: TFormBorderStyle; read write;
   property Caption: String; read write;
@@ -274,6 +279,7 @@ TAlignment = (taLeftJustify, taRightJustify, taCenter);
 
 TLabel = class(TCustomLabel)
   property Alignment: TAlignment; read write;
+  property Anchors: TAnchors; read write;
   property AutoSize: Boolean; read write;
   property Caption: String; read write;
   property Color: TColor; read write;
@@ -300,6 +306,7 @@ TBorderStyle = TFormBorderStyle;
 TEditCharCase = (ecNormal, ecUpperCase, ecLowerCase);
 
 TEdit = class(TCustomEdit)
+  property Anchors: TAnchors; read write;
   property AutoSelect: Boolean; read write;
   property AutoSize: Boolean; read write;
   property BorderStyle: TBorderStyle; read write;
@@ -329,12 +336,13 @@ end;
 TScrollStyle = (ssNone, ssHorizontal, ssVertical, ssBoth);
 
 TMemo = class(TCustomMemo)
-  property Lines: TStrings; read write;
   property Alignment: TAlignment; read write;
+  property Anchors: TAnchors; read write;
   property BorderStyle: TBorderStyle; read write;
   property Color: TColor; read write;
   property Font: TFont; read write;
   property HideSelection: Boolean; read write;
+  property Lines: TStrings; read write;
   property MaxLength: Integer; read write;
   property ReadOnly: Boolean; read write;
   property ScrollBars: TScrollStyle; read write;
@@ -361,12 +369,13 @@ end;
 TComboBoxStyle = (csDropDown, csSimple, csDropDownList, csOwnerDrawFixed, csOwnerDrawVariable);
 
 TComboBox = class(TCustomComboBox)
-  property Style: TComboBoxStyle; read write;
+  property Anchors: TAnchors; read write;
   property Color: TColor; read write;
   property DropDownCount: Integer; read write;
   property Font: TFont; read write;
   property MaxLength: Integer; read write;
   property Sorted: Boolean; read write;
+  property Style: TComboBoxStyle; read write;
   property Text: String; read write;
   property OnChange: TNotifyEvent; read write;
   property OnClick: TNotifyEvent; read write;
@@ -384,6 +393,7 @@ TButtonControl = class(TWinControl)
 end;
 
 TButton = class(TButtonControl)
+  property Anchors: TAnchors; read write;
   property Cancel: Boolean; read write;
   property Caption: String; read write;
   property Default: Boolean; read write;
@@ -403,6 +413,7 @@ TCheckBoxState = (cbUnchecked, cbChecked, cbGrayed);
 TCheckBox = class(TCustomCheckBox)
   property Alignment: TAlignment; read write;
   property AllowGrayed: Boolean; read write;
+  property Anchors: TAnchors; read write;
   property Caption: String; read write;
   property Checked: Boolean; read write;
   property Color: TColor; read write;
@@ -416,6 +427,7 @@ end;
 
 TRadioButton = class(TButtonControl)
   property Alignment: TAlignment; read write;
+  property Anchors: TAnchors; read write;
   property Caption: String; read write;
   property Checked: Boolean; read write;
   property Color: TColor; read write;
@@ -437,6 +449,7 @@ end;
 TListBoxStyle = (lbStandard, lbOwnerDrawFixed, lbOwnerDrawVariable);
 
 TListBox = class(TCustomListBox)
+  property Anchors: TAnchors; read write;
   property BorderStyle: TBorderStyle; read write;
   property Color: TColor; read write;
   property Font: TFont; read write;
@@ -460,6 +473,7 @@ TBevelShape = (bsBox, bsFrame, bsTopLine, bsBottomLine, bsLeftLine, bsRightLine,
 TBevelStyle = (bsLowered, bsRaised);
 
 TBevel = class(TGraphicControl)
+  property Anchors: TAnchors; read write;
   property Shape: TBevelShape; read write;
   property Style: TBevelStyle; read write;
 end;
@@ -475,6 +489,7 @@ TBorderWidth = Longint;
 
 TPanel = class(TCustomPanel)
   property Alignment: TAlignment; read write;
+  property Anchors: TAnchors; read write;
   property BevelInner: TPanelBevel; read write;
   property BevelKind: TBevelKind; read write;
   property BevelOuter: TPanelBevel; read write;
@@ -490,6 +505,7 @@ end;
 
 TNewStaticText = class(TWinControl)
   function AdjustHeight: Integer;
+  property Anchors: TAnchors; read write;
   property AutoSize: Boolean; read write;
   property Caption: String; read write;
   property Color: TColor; read write;
@@ -509,6 +525,7 @@ TNewCheckListBox = class(TCustomListBox)
   function AddGroup(ACaption, ASubItem: String; ALevel: Byte; AObject: TObject): Integer;
   function AddRadioButton(const ACaption, ASubItem: String; ALevel: Byte; AChecked, AEnabled: Boolean; AObject: TObject): Integer;
   function CheckItem(const Index: Integer; const AOperation: TCheckItemOperation): Boolean;
+  property Anchors: TAnchors; read write;
   property Checked[Index: Integer]: Boolean; read write;
   property State[Index: Integer]: TCheckBoxState; read write;
   property ItemCaption[Index: Integer]: String; read write;
@@ -539,6 +556,7 @@ TNewProgressBarState = (npbsNormal, npbsError, npbsPaused);
 TNewProgressBarStyle = (npbstNormal, npbstMarquee);
 
 TNewProgressBar = class(TWinControl)
+  property Anchors: TAnchors; read write;
   property Min: Longint; read write;
   property Max: Longint; read write;
   property Position: Longint; read write;
@@ -548,6 +566,7 @@ TNewProgressBar = class(TWinControl)
 end;
 
 TRichEditViewer = class(TMemo)
+  property Anchors: TAnchors; read write;
   property BevelKind: TBevelKind; read write;
   property BorderStyle: TBorderStyle; read write;
   property RTFText: AnsiString; write;
@@ -555,6 +574,7 @@ TRichEditViewer = class(TMemo)
 end;
 
 TPasswordEdit = class(TCustomEdit)
+  property Anchors: TAnchors; read write;
   property AutoSelect: Boolean; read write;
   property AutoSize: Boolean; read write;
   property BorderStyle: TBorderStyle; read write;
@@ -582,12 +602,14 @@ end;
 TFolderRenameEvent = procedure(Sender: TCustomFolderTreeView; var NewName: String; var Accept: Boolean);
 
 TFolderTreeView = class(TCustomFolderTreeView)
+  property Anchors: TAnchors; read write;
   property OnChange: TNotifyEvent; read write;
   property OnRename: TFolderRenameEvent; read write;
 end;
 
 TStartMenuFolderTreeView = class(TCustomFolderTreeView)
   procedure SetPaths(const AUserPrograms, ACommonPrograms, AUserStartup, ACommonStartup: String);
+  property Anchors: TAnchors; read write;
   property OnChange: TNotifyEvent; read write;
   property OnRename: TFolderRenameEvent; read write;
 end;
@@ -595,6 +617,7 @@ end;
 TAlphaFormat = (afIgnored, afDefined, afPremultiplied);
 
 TBitmapImage = class(TGraphicControl)
+  property Anchors: TAnchors; read write;
   property AutoSize: Boolean; read write;
   property BackColor: TColor; read write;
   property Center: Boolean; read write;
@@ -608,6 +631,7 @@ end;
 
 TNewNotebook = class(TWinControl)
   function FindNextPage(CurPage: TNewNotebookPage; GoForward: Boolean): TNewNotebookPage;
+  property Anchors: TAnchors; read write;
   property PageCount: Integer; read write;
   property Pages[Index: Integer]: TNewNotebookPage; read;
   property ActivePage: TNewNotebookPage; read write;
@@ -629,6 +653,7 @@ TWizardPage = class(TComponent)
   property Caption: String; read write;
   property Description: String; read write;
   property Surface: TNewNotebookPage; read;
+  property SurfaceColor: TColor; read;
   property SurfaceHeight: Integer; read;
   property SurfaceWidth: Integer; read;
   property OnActivate: TWizardPageNotifyEvent; read write;
@@ -697,12 +722,14 @@ TUIStateForm = class(TForm)
 end;
 
 TSetupForm = class(TUIStateForm)
-  procedure Center;
-  procedure CenterInsideControl(const Ctl: TWinControl; const InsideClientArea: Boolean);
-  procedure FlipControlsIfNeeded;
+  function ShouldSizeX: Boolean;
+  function ShouldSizeY: Boolean;
+  procedure FlipSizeAndCenterIfNeeded(const ACenterInsideControl: Boolean; const CenterInsideControlCtl: TWinControl; const CenterInsideControlInsideClientArea: Boolean);
   property ControlsFlipped: Boolean; read;
   property FlipControlsOnShow: Boolean; read write;
+  property KeepSizeY: Boolean; read; write;
   property RightToLeft: Boolean; read;
+  property SizeAndCenterOnShow: Boolean; read write;
 end;
 
 TMainForm = class(TSetupForm)

+ 24 - 10
Projects/CompSignTools.dfm

@@ -2,80 +2,94 @@ object SignToolsForm: TSignToolsForm
   Left = 330
   Top = 188
   BorderIcons = [biSystemMenu]
-  BorderStyle = bsDialog
-  Caption = 'Sign Tools'
+  Caption = 'Configure Sign Tools'
   ClientHeight = 247
-  ClientWidth = 377
+  ClientWidth = 577
+  Color = clBtnFace
   Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Height = -11
   Font.Name = 'MS Sans Serif'
   Font.Style = []
+  OldCreateOrder = True
   Position = poScreenCenter
   OnCreate = FormCreate
   OnDestroy = FormDestroy
+  DesignSize = (
+    577
+    247)
   PixelsPerInch = 96
   TextHeight = 13
   object GroupBox1: TGroupBox
     Left = 8
     Top = 8
-    Width = 361
+    Width = 561
     Height = 201
+    Anchors = [akLeft, akTop, akRight, akBottom]
     Caption = ' Sign Tools '
     TabOrder = 0
+    DesignSize = (
+      561
+      201)
     object SignToolsListBox: TListBox
       Left = 8
       Top = 16
-      Width = 265
+      Width = 465
       Height = 177
+      Anchors = [akLeft, akTop, akRight, akBottom]
       ItemHeight = 13
       TabOrder = 0
       OnClick = SignToolsListBoxClick
     end
     object AddButton: TButton
-      Left = 280
+      Left = 480
       Top = 18
       Width = 73
       Height = 23
+      Anchors = [akTop, akRight]
       Caption = '&Add...'
       Default = True
       TabOrder = 1
       OnClick = AddButtonClick
     end
     object RemoveButton: TButton
-      Left = 280
+      Left = 480
       Top = 74
       Width = 73
       Height = 23
+      Anchors = [akTop, akRight]
       Caption = 'Remo&ve'
       TabOrder = 3
       OnClick = RemoveButtonClick
     end
     object EditButton: TButton
-      Left = 280
+      Left = 480
       Top = 46
       Width = 73
       Height = 23
+      Anchors = [akTop, akRight]
       Caption = '&Edit...'
       TabOrder = 2
       OnClick = EditButtonClick
     end
   end
   object OKButton: TButton
-    Left = 216
+    Left = 416
     Top = 217
     Width = 73
     Height = 23
+    Anchors = [akRight, akBottom]
     Caption = 'OK'
     Default = True
     ModalResult = 1
     TabOrder = 1
   end
   object CancelButton: TButton
-    Left = 296
+    Left = 496
     Top = 217
     Width = 73
     Height = 23
+    Anchors = [akRight, akBottom]
     Cancel = True
     Caption = 'Cancel'
     ModalResult = 2

+ 17 - 0
Projects/CompSignTools.pas

@@ -39,6 +39,9 @@ type
     procedure SetSignTools(SignTools: TStringList);
     function InputSignTool(var SignToolName, SignToolCommand: String;
       ExistingIndex: Integer): Boolean;
+  protected
+    procedure CreateWnd; override;
+    procedure CreateParams(var Params: TCreateParams); override;
   public
     property SignTools: TStringList read FSignTools write SetSignTools;
   end;
@@ -78,6 +81,20 @@ begin
   InitFormFont(Self);
 end;
 
+{ This and CreateParams make bsSizeable (which has an unwanted icon) look like bsDialog, see:
+  https://stackoverflow.com/questions/32096482/delphi-resizable-bsdialog-form/32098633 }
+procedure TSignToolsForm.CreateWnd;
+begin
+  inherited;
+  SendMessage(Handle, WM_SETICON, ICON_BIG, 0);
+end;
+
+procedure TSignToolsForm.CreateParams(var Params: TCreateParams);
+begin
+  inherited CreateParams(Params);
+  Params.ExStyle := Params.ExStyle or WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE;
+end;
+
 procedure TSignToolsForm.FormDestroy(Sender: TObject);
 begin
   FSignTools.Free();

+ 1 - 0
Projects/CompWizard.dfm

@@ -957,6 +957,7 @@ object WizardForm: TWizardForm
         Width = 499
         Height = 1
         Shape = bsTopLine
+        Visible = False
       end
       object Notebook2: TNotebook
         Left = 4

+ 2 - 9
Projects/CompWizard.pas

@@ -225,10 +225,8 @@ end;
 
 { --- }
 
-{$IFDEF IS_D7}
 type
   TNotebookAccess = class(TNotebook);
-{$ENDIF}
 
 procedure TWizardForm.FormCreate(Sender: TObject);
 
@@ -281,10 +279,8 @@ begin
   if FontExists('Verdana') then
     WelcomeLabel1.Font.Name := 'Verdana';
 
-{$IFDEF IS_D7}
   TNotebookAccess(Notebook1).ParentBackground := False;
-  PnlMain.ParentBackground := False;
-{$ENDIF}
+  Notebook1.Color := clWindow;
 
   MakeBold(PageNameLabel);
   MakeBold(RequiredLabel1);
@@ -398,10 +394,6 @@ begin
   { Set the Caption to match the current page's title }
   PageNameLabel.Caption := PageCaptions[CurPage];
   PageDescriptionLabel.Caption := PageDescriptions[CurPage];
-  if CurPage in [wpWelcome, wpFinished] then
-    Notebook1.Color := clWindow
-  else
-    Notebook1.Color := clBtnFace;
 
   { Adjust focus }
   case CurPage of
@@ -1062,6 +1054,7 @@ begin
     { Other }
     Setup := Setup + 'Compression=lzma' + SNewLine;
     Setup := Setup + 'SolidCompression=yes' + SNewLine;
+    Setup := Setup + 'WizardStyle=modern' + SNewLine;
 
     { Build script }
     if ISPP <> '' then

+ 42 - 3
Projects/Compile.pas

@@ -205,8 +205,10 @@ type
     ssWizardImageBackColor,
     ssWizardImageFile,
     ssWizardImageStretch,
+    ssWizardResizable,
     ssWizardSmallImageBackColor,
     ssWizardSmallImageFile,
+    ssWizardSizePercent,
     ssWizardStyle);
   TLangOptionsSectionDirectives = (
     lsCopyrightFontName,
@@ -3717,6 +3719,24 @@ var
         1: Result := Result + [proCommandLine, proDialog];
       end;
   end;
+
+  procedure StrToPercentages(const S: String; var X, Y: Integer; const Min: Integer);
+  var
+    I: Integer;
+  begin
+    I := Pos(',', S);
+    if I = Length(S) then Invalid;
+    if I <> 0 then begin
+      X := StrToIntDef(Copy(S, 1, I-1), -1);
+      Y := StrToIntDef(Copy(S, I+1, Maxint), -1);
+    end else begin
+      X := StrToIntDef(S, -1);
+      Y := X;
+    end;
+    if (X < Min) or (Y < Min) then
+      Invalid;
+  end;
+
 var
   P: Integer;
   AIncludes: TStringList;
@@ -4423,15 +4443,24 @@ begin
           Invalid;
         WizardImageFile := Value;
       end;
+    ssWizardResizable: begin
+        SetSetupHeaderOption(shWizardResizable);
+      end;
     ssWizardSmallImageFile: begin
         if Value = '' then
           Invalid;
         WizardSmallImageFile := Value;
       end;
+    ssWizardSizePercent: begin
+        StrToPercentages(Value, SetupHeader.WizardSizePercentX,
+          SetupHeader.WizardSizePercentY, 100)
+      end;
     ssWizardStyle: begin
-        if CompareText(Value, 'modern') = 0 then begin
-          { no-op }
-        end else
+        if CompareText(Value, 'classic') = 0 then
+          SetupHeader.WizardStyle := wsClassic
+        else if CompareText(Value, 'modern') = 0 then
+          SetupHeader.WizardStyle := wsModern
+        else
           Invalid;
       end;
   end;
@@ -8622,6 +8651,7 @@ begin
     SetupHeader.CloseApplicationsFilter := '*.exe,*.dll,*.chm';
     SetupHeader.WizardImageAlphaFormat := afIgnored;
     UsedUserAreasWarning := True;
+    SetupHeader.WizardStyle := wsClassic;
 
     { Read [Setup] section }
     EnumIniSection(EnumSetup, 'Setup', 0, 0, True, True, '', False, False);
@@ -8803,6 +8833,15 @@ begin
     end;
     if shAlwaysUsePersonalGroup in SetupHeader.Options then
       UsedUserAreas.Add('AlwaysUsePersonalGroup');
+    if SetupDirectiveLines[ssWizardSizePercent] = 0 then begin
+      if SetupHeader.WizardStyle = wsModern then
+        SetupHeader.WizardSizePercentX := 120
+      else
+        SetupHeader.WizardSizePercentX := 100;
+      SetupHeader.WizardSizePercentY := SetupHeader.WizardSizePercentX;
+    end;
+    if (SetupDirectiveLines[ssWizardResizable] = 0) and (SetupHeader.WizardStyle = wsModern) then
+      Include(SetupHeader.Options, shWizardResizable);
 
     LineNumber := 0;
 

+ 2 - 1
Projects/Install.pas

@@ -3037,7 +3037,8 @@ begin
       else if IsPowerUserOrAdmin then
         { Note: This flag is only set in 5.1.9 and later }
         Include(UninstLog.Flags, ufPowerUserInstalled);
-      Include(UninstLog.Flags, ufModernStyle);
+      if SetupHeader.WizardStyle = wsModern then
+        Include(UninstLog.Flags, ufModernStyle);
       if shUninstallRestartComputer in SetupHeader.Options then
         Include(UninstLog.Flags, ufAlwaysRestart);
       if ChangesEnvironment then

+ 1 - 1
Projects/Main.pas

@@ -3831,7 +3831,7 @@ begin
       raise;
     end;
   end;
-  WizardForm.FlipControlsIfNeeded;
+  WizardForm.FlipSizeAndCenterIfNeeded(shWindowVisible in SetupHeader.Options, MainForm, True);
   WizardForm.SetCurPage(wpWelcome);
   if InstallMode = imNormal then begin
     WizardForm.ClickToStartPage; { this won't go past wpReady  }

+ 11 - 0
Projects/NewDisk.dfm

@@ -6,12 +6,18 @@ object NewDiskForm: TNewDiskForm
   Caption = '*'
   ClientHeight = 169
   ClientWidth = 377
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Height = -11
   Font.Name = 'MS Sans Serif'
   Font.Style = []
+  OldCreateOrder = True
   Scaled = False
   OnCloseQuery = FormCloseQuery
+  DesignSize = (
+    377
+    169)
   PixelsPerInch = 96
   TextHeight = 13
   object DiskBitmapImage: TBitmapImage
@@ -25,6 +31,7 @@ object NewDiskForm: TNewDiskForm
     Top = 137
     Width = 73
     Height = 23
+    Anchors = [akRight, akBottom]
     Cancel = True
     Caption = '*'
     ModalResult = 2
@@ -35,6 +42,7 @@ object NewDiskForm: TNewDiskForm
     Top = 137
     Width = 73
     Height = 23
+    Anchors = [akRight, akBottom]
     Caption = '*'
     Default = True
     ModalResult = 1
@@ -45,6 +53,7 @@ object NewDiskForm: TNewDiskForm
     Top = 95
     Width = 73
     Height = 23
+    Anchors = [akTop, akRight]
     Caption = '*'
     TabOrder = 3
     OnClick = BrowseButtonClick
@@ -54,6 +63,7 @@ object NewDiskForm: TNewDiskForm
     Top = 96
     Width = 281
     Height = 21
+    Anchors = [akLeft, akTop, akRight]
     TabOrder = 2
   end
   object PathLabel: TNewStaticText
@@ -70,6 +80,7 @@ object NewDiskForm: TNewDiskForm
     Top = 8
     Width = 297
     Height = 72
+    Anchors = [akLeft, akTop, akRight]
     AutoSize = False
     Caption = '*'
     ShowAccelChar = False

+ 5 - 6
Projects/NewDisk.pas

@@ -73,12 +73,6 @@ begin
   inherited;
 
   InitializeFont;
-  { WizardForm will not exist yet if we're being called from [Code]'s
-    ExtractTemporaryFile in InitializeSetup }
-  if Assigned(WizardForm) then
-    CenterInsideControl(WizardForm, False)
-  else
-    Center;
 
   Caption := SetupMessages[msgChangeDiskTitle];
   PathLabel.Caption := SetupMessages[msgPathLabel];
@@ -91,6 +85,11 @@ begin
   DiskBitmapImage.ReplaceWithColor := Color;
 
   TryEnableAutoCompleteFileSystem(PathEdit.Handle);
+
+  KeepSizeY := True;
+  { WizardForm will not exist yet if we're being called from [Code]'s
+    ExtractTemporaryFile in InitializeSetup }
+  FlipSizeAndCenterIfNeeded(Assigned(WizardForm), WizardForm, False);
 end;
 
 function TNewDiskForm.GetSanitizedPath: String;

+ 15 - 2
Projects/ScriptClasses_C.pas

@@ -42,6 +42,7 @@ begin
   with Cl.AddClassN(Cl.FindClass('TWinControl'), 'TNewStaticText') do
   begin
     RegisterMethod('function AdjustHeight: Integer');
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('AutoSize', 'Boolean', iptrw);
     RegisterProperty('Caption', 'String', iptrw);
     RegisterProperty('Color', 'TColor', iptrw);
@@ -79,6 +80,7 @@ begin
     RegisterMethod('function AddGroup(const ACaption, ASubItem: string; ALevel: Byte; AObject: TObject): Integer');
     RegisterMethod('function AddRadioButton(const ACaption, ASubItem: string; ALevel: Byte; AChecked, AEnabled: Boolean; AObject: TObject): Integer');
     RegisterMethod('function CheckItem(const Index: Integer; const AOperation: TCheckItemOperation): Boolean');
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('Checked', 'Boolean Integer', iptrw);
     RegisterProperty('State', 'TCheckBoxState Integer', iptr);
     RegisterProperty('ItemCaption', 'String Integer', iptrw);
@@ -130,6 +132,7 @@ begin
   cl.AddTypeS('TNewProgressBarStyle', '(npbstNormal, npbstMarquee)');
   with Cl.AddClassN(Cl.FindClass('TWinControl'), 'TNewProgressBar') do
   begin
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('Min', 'Longint', iptrw);
     RegisterProperty('Max', 'Longint', iptrw);
     RegisterProperty('Position', 'Longint', iptrw);
@@ -142,6 +145,7 @@ procedure RegisterRichEditViewer_C(Cl: TPSPascalCompiler);
 begin
   with Cl.AddClassN(Cl.FindClass('TMemo'), 'TRichEditViewer') do
   begin
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('BevelKind', 'TBevelKind', iptrw);
     RegisterProperty('BorderStyle', 'TBorderStyle', iptrw);
     RegisterProperty('RTFText', 'AnsiString', iptw);
@@ -153,6 +157,7 @@ procedure RegisterPasswordEdit_C(Cl: TPSPascalCompiler);
 begin
   with Cl.AddClassN(cl.FindClass('TCustomEdit'), 'TPasswordEdit') do
   begin
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('AutoSelect', 'Boolean', iptrw);
     RegisterProperty('AutoSize', 'Boolean', iptrw);
     RegisterProperty('BorderStyle', 'TBorderStyle', iptrw);
@@ -209,6 +214,7 @@ procedure RegisterFolderTreeView_C(Cl: TPSPascalCompiler);
 begin
   with Cl.AddClassN(Cl.FindClass('TCustomFolderTreeView'),'TFolderTreeView') do
   begin
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('OnChange', 'TNotifyEvent', iptrw);
     RegisterProperty('OnRename', 'TFolderRenameEvent', iptrw);
   end;
@@ -219,6 +225,7 @@ begin
   with Cl.AddClassN(Cl.FindClass('TCustomFolderTreeView'),'TStartMenuFolderTreeView') do
   begin
     RegisterMethod('procedure SetPaths(const AUserPrograms, ACommonPrograms, AUserStartup, ACommonStartup: String)');
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('OnChange', 'TNotifyEvent', iptrw);
     RegisterProperty('OnRename', 'TFolderRenameEvent', iptrw);
   end;
@@ -233,6 +240,7 @@ begin
   end;
   with Cl.AddClassN(CL.FindClass('TGraphicControl'),'TBitmapImage') do
   begin
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('AutoSize', 'Boolean', iptrw);
     RegisterProperty('BackColor', 'TColor', iptrw);
     RegisterProperty('Center', 'Boolean', iptrw);
@@ -263,6 +271,7 @@ begin
   with Cl.AddClassN(Cl.FindClass('TWinControl'),'TNewNotebook') do
   begin
     RegisterMethod('function FindNextPage(CurPage: TNewNotebookPage; GoForward: Boolean): TNewNotebookPage');
+    RegisterProperty('Anchors', 'TAnchors', iptrw);
     RegisterProperty('PageCount', 'Integer', iptr);
     RegisterProperty('Pages', 'TNewNotebookPage Integer', iptr);
     RegisterProperty('ActivePage', 'TNewNotebookPage', iptrw);
@@ -288,11 +297,14 @@ procedure RegisterSetupForm_C(Cl: TPSPascalCompiler);
 begin
   with Cl.AddClassN(Cl.FindClass('TUIStateForm'), 'TSetupForm') do
   begin
-    RegisterMethod('procedure Center');
-    RegisterMethod('procedure CenterInsideControl(const Ctl: TWinControl; const InsideClientArea: Boolean)');
+    RegisterMethod('function ShouldSizeX: Boolean;');
+    RegisterMethod('function ShouldSizeY: Boolean;');
+    RegisterMethod('procedure FlipSizeAndCenterIfNeeded(const ACenterInsideControl: Boolean; const CenterInsideControlCtl: TWinControl; const CenterInsideControlInsideClientArea: Boolean)');
     RegisterProperty('ControlsFlipped', 'Boolean', iptr);
     RegisterProperty('FlipControlsOnShow', 'Boolean', iptrw);
+    RegisterProperty('KeepSizeY', 'Boolean', iptrw);
     RegisterProperty('RightToLeft', 'Boolean', iptr);
+    RegisterProperty('SizeAndCenterOnShow', 'Boolean', iptrw);
   end;
 end;
 
@@ -432,6 +444,7 @@ begin
     RegisterProperty('Caption', 'String', iptrw);
     RegisterProperty('Description', 'String', iptrw);
     RegisterProperty('Surface', 'TNewNotebookPage', iptr);
+    RegisterProperty('SurfaceColor', 'TColor', iptr);
     RegisterProperty('SurfaceHeight', 'Integer', iptr);
     RegisterProperty('SurfaceWidth', 'Integer', iptr);
     RegisterProperty('OnActivate', 'TWizardPageNotifyEvent', iptrw);

+ 11 - 2
Projects/ScriptClasses_R.pas

@@ -185,17 +185,24 @@ end;
 procedure TSetupFormControlsFlipped_R(Self: TSetupForm; var T: Boolean); begin T := Self.ControlsFlipped; end;
 procedure TSetupFormFlipControlsOnShow_W(Self: TSetupForm; const T: Boolean); begin Self.FlipControlsOnShow := T; end;
 procedure TSetupFormFlipControlsOnShow_R(Self: TSetupForm; var T: Boolean); begin T := Self.FlipControlsOnShow; end;
+procedure TSetupFormKeepSizeY_W(Self: TSetupForm; const T: Boolean); begin Self.KeepSizeY := T; end;
+procedure TSetupFormKeepSizeY_R(Self: TSetupForm; var T: Boolean); begin T := Self.KeepSizeY; end;
 procedure TSetupFormRightToLeft_R(Self: TSetupForm; var T: Boolean); begin T := Self.RightToLeft; end;
+procedure TSetupFormSizeAndCenterOnShow_W(Self: TSetupForm; const T: Boolean); begin Self.SizeAndCenterOnShow := T; end;
+procedure TSetupFormSizeAndCenterOnShow_R(Self: TSetupForm; var T: Boolean); begin T := Self.SizeAndCenterOnShow; end;
 
 procedure RegisterSetupForm_R(Cl: TPSRuntimeClassImporter);
 begin
   with Cl.Add(TSetupForm) do
   begin
-    RegisterMethod(@TSetupForm.Center, 'Center');
-    RegisterMethod(@TSetupForm.CenterInsideControl, 'CenterInsideControl');
+    RegisterMethod(@TSetupForm.ShouldSizeX, 'ShouldSizeX');
+    RegisterMethod(@TSetupForm.ShouldSizeY, 'ShouldSizeY');
+    RegisterMethod(@TSetupForm.FlipSizeAndCenterIfNeeded, 'FlipSizeAndCenterIfNeeded');
     RegisterPropertyHelper(@TSetupFormControlsFlipped_R, nil, 'ControlsFlipped');
     RegisterPropertyHelper(@TSetupFormFlipControlsOnShow_R, @TSetupFormFlipControlsOnShow_W, 'FlipControlsOnShow');
+    RegisterPropertyHelper(@TSetupFormKeepSizeY_R, @TSetupFormKeepSizeY_W, 'KeepSizeY');
     RegisterPropertyHelper(@TSetupFormRightToLeft_R, nil, 'RightToLeft');
+    RegisterPropertyHelper(@TSetupFormSizeAndCenterOnShow_R, @TSetupFormSizeAndCenterOnShow_W, 'SizeAndCenterOnShow');
   end;
 end;
 
@@ -425,6 +432,7 @@ procedure TWizardPageCaption_W(Self: TWizardPage; T: String); begin Self.Caption
 procedure TWizardPageDescription_R(Self: TWizardPage; var T: String); begin T := Self.Description; end;
 procedure TWizardPageDescription_W(Self: TWizardPage; T: String); begin Self.Description := T; end;
 procedure TWizardPageSurface_R(Self: TWizardPage; var T: TNewNotebookPage); begin T := Self.Surface; end;
+procedure TWizardPageSurfaceColor_R(Self: TWizardPage; var T: TColor); begin T := Self.SurfaceColor; end;
 procedure TWizardPageSurfaceHeight_R(Self: TWizardPage; var T: Integer); begin T := Self.SurfaceHeight; end;
 procedure TWizardPageSurfaceWidth_R(Self: TWizardPage; var T: Integer); begin T := Self.SurfaceWidth; end;
 procedure TWizardPageOnActivate_R(Self: TWizardPage; var T: TWizardPageNotifyEvent); begin T := Self.OnActivate; end;
@@ -446,6 +454,7 @@ begin
     RegisterPropertyHelper(@TWizardPageCaption_R, @TWizardPageCaption_W, 'Caption');
     RegisterPropertyHelper(@TWizardPageDescription_R, @TWizardPageDescription_W, 'Description');
     RegisterPropertyHelper(@TWizardPageSurface_R, nil, 'Surface');
+    RegisterPropertyHelper(@TWizardPageSurfaceColor_R, nil, 'SurfaceColor');
     RegisterPropertyHelper(@TWizardPageSurfaceHeight_R, nil, 'SurfaceHeight');
     RegisterPropertyHelper(@TWizardPageSurfaceWidth_R, nil, 'SurfaceWidth');
     RegisterPropertyHelper(@TWizardPageOnActivate_R, @TWizardPageOnActivate_W, 'OnActivate');

+ 1 - 1
Projects/ScriptDlg.pas

@@ -302,7 +302,7 @@ begin
   FExclusive := Exclusive;
   if not ListBox then begin
     FCheckListBox.BorderStyle := bsNone;
-    FCheckListBox.Color := clBtnFace;
+    FCheckListBox.Color := SurfaceColor;
     FCheckListBox.MinItemHeight := WizardForm.ScalePixelsY(22);
     FCheckListBox.WantTabs := True;
   end;

+ 11 - 0
Projects/SelFolderForm.dfm

@@ -6,11 +6,17 @@ object SelectFolderForm: TSelectFolderForm
   Caption = 'SelectFolderForm'
   ClientHeight = 337
   ClientWidth = 349
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Height = -11
   Font.Name = 'MS Sans Serif'
   Font.Style = []
+  OldCreateOrder = True
   Scaled = False
+  DesignSize = (
+    349
+    337)
   PixelsPerInch = 96
   TextHeight = 13
   object CancelButton: TNewButton
@@ -18,6 +24,7 @@ object SelectFolderForm: TSelectFolderForm
     Top = 305
     Width = 17
     Height = 23
+    Anchors = [akRight, akBottom]
     Cancel = True
     Caption = '*'
     ModalResult = 2
@@ -28,6 +35,7 @@ object SelectFolderForm: TSelectFolderForm
     Top = 305
     Width = 16
     Height = 23
+    Anchors = [akRight, akBottom]
     Caption = '*'
     Default = True
     Enabled = False
@@ -39,6 +47,7 @@ object SelectFolderForm: TSelectFolderForm
     Top = 305
     Width = 17
     Height = 23
+    Anchors = [akLeft, akBottom]
     Cancel = True
     Caption = '*'
     Enabled = False
@@ -50,6 +59,7 @@ object SelectFolderForm: TSelectFolderForm
     Top = 36
     Width = 317
     Height = 21
+    Anchors = [akLeft, akTop, akRight]
     TabOrder = 1
     OnChange = PathEditChange
   end
@@ -58,6 +68,7 @@ object SelectFolderForm: TSelectFolderForm
     Top = 12
     Width = 325
     Height = 14
+    Anchors = [akLeft, akTop, akRight]
     AutoSize = False
     Caption = '*'
     TabOrder = 0

+ 2 - 1
Projects/SelFolderForm.pas

@@ -110,6 +110,7 @@ begin
     TStartMenuFolderTreeView(FFolderTreeView).OnRename := WizardForm.GroupTreeRename;
   end;
   FFolderTreeView.SetBounds(16, 64, 317, 229);
+  FFolderTreeView.Anchors := [akLeft, akTop, akRight, akBottom];
   FFolderTreeView.Visible := False;
   FFolderTreeView.Parent := Self;
   PathEdit.BringToFront;     { for MSAA }
@@ -137,7 +138,7 @@ begin
     OKButton.Top + YDiff, W, OKButton.Height);
   ClientHeight := ClientHeight + YDiff;
 
-  CenterInsideControl(WizardForm, False);
+  FlipSizeAndCenterIfNeeded(True, WizardForm, False);
 end;
 
 constructor TSelectFolderForm.Create2(AOwner: TComponent; AStartMenu: Boolean);

+ 58 - 28
Projects/SelLangForm.dfm

@@ -4,60 +4,90 @@ object SelectLanguageForm: TSelectLanguageForm
   BorderIcons = [biSystemMenu]
   BorderStyle = bsDialog
   Caption = 'SelectLanguageForm'
-  ClientHeight = 125
+  ClientHeight = 132
   ClientWidth = 297
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Height = -11
   Font.Name = 'MS Sans Serif'
   Font.Style = []
+  OldCreateOrder = True
   Scaled = False
+  DesignSize = (
+    297
+    132)
   PixelsPerInch = 96
   TextHeight = 13
-  object IconBitmapImage: TBitmapImage
-    Left = 8
-    Top = 8
-    Width = 32
-    Height = 32
+  object Bevel: TBevel
+    Left = 0
+    Top = 89
+    Width = 297
+    Height = 1
+    Anchors = [akLeft, akRight, akBottom]
+    Shape = bsTopLine
   end
   object CancelButton: TNewButton
     Left = 214
-    Top = 93
+    Top = 100
     Width = 75
     Height = 23
+    Anchors = [akRight, akBottom]
     Cancel = True
     Caption = '*'
     ModalResult = 2
-    TabOrder = 3
+    TabOrder = 2
   end
   object OKButton: TNewButton
     Left = 133
-    Top = 93
+    Top = 100
     Width = 75
     Height = 23
+    Anchors = [akRight, akBottom]
     Caption = '*'
     Default = True
     ModalResult = 1
-    TabOrder = 2
-  end
-  object LangCombo: TNewComboBox
-    Left = 56
-    Top = 56
-    Width = 233
-    Height = 21
-    Style = csDropDownList
-    DropDownCount = 16
-    ItemHeight = 13
-    Sorted = True
     TabOrder = 1
   end
-  object SelectLabel: TNewStaticText
-    Left = 56
-    Top = 8
-    Width = 233
-    Height = 39
-    AutoSize = False
-    Caption = '*'
+  object MainPanel: TPanel
+    Left = 0
+    Top = 0
+    Width = 297
+    Height = 89
+    Anchors = [akLeft, akTop, akRight]
+    BevelOuter = bvNone
+    Color = clWindow
     TabOrder = 0
-    WordWrap = True
+    DesignSize = (
+      297
+      89)
+    object IconBitmapImage: TBitmapImage
+      Left = 8
+      Top = 8
+      Width = 32
+      Height = 32
+    end
+    object LangCombo: TNewComboBox
+      Left = 56
+      Top = 56
+      Width = 233
+      Height = 21
+      Style = csDropDownList
+      Anchors = [akLeft, akTop, akRight]
+      DropDownCount = 16
+      Sorted = True
+      TabOrder = 1
+    end
+    object SelectLabel: TNewStaticText
+      Left = 56
+      Top = 8
+      Width = 233
+      Height = 39
+      Anchors = [akLeft, akTop, akRight]
+      AutoSize = False
+      Caption = '*'
+      TabOrder = 0
+      WordWrap = True
+    end
   end
 end

+ 12 - 5
Projects/SelLangForm.pas

@@ -2,17 +2,17 @@ unit SelLangForm;
 
 {
   Inno Setup
-  Copyright (C) 1997-2006 Jordan Russell
+  Copyright (C) 1997-2019 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
   "Select Language" form
-
-  $jrsoftware: issrc/Projects/SelLangForm.pas,v 1.18 2010/01/13 17:48:52 mlaan Exp $
 }
 
 interface
 
+{$I VERSION.INC}
+
 uses
   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
   SetupForm, StdCtrls, ExtCtrls, NewStaticText, BitmapImage, BidiCtrls;
@@ -24,6 +24,8 @@ type
     OKButton: TNewButton;
     CancelButton: TNewButton;
     IconBitmapImage: TBitmapImage;
+    MainPanel: TPanel;
+    Bevel: TBevel;
   private
     { Private declarations }
   public
@@ -157,20 +159,25 @@ constructor TSelectLanguageForm.Create(AOwner: TComponent);
 begin
   inherited;
 
+{$IFDEF IS_D7}
+  MainPanel.ParentBackground := False;
+{$ENDIF}
+
   InitializeFont;
-  Center;
 
   Caption := SetupMessages[msgSelectLanguageTitle];
   SelectLabel.Caption := SetupMessages[msgSelectLanguageLabel];
   OKButton.Caption := SetupMessages[msgButtonOK];
   CancelButton.Caption := SetupMessages[msgButtonCancel];
 
-  IconBitmapImage.Bitmap.Canvas.Brush.Color := Color;
+  IconBitmapImage.Bitmap.Canvas.Brush.Color := MainPanel.Color;
   IconBitmapImage.Bitmap.Width := Application.Icon.Width;
   IconBitmapImage.Bitmap.Height := Application.Icon.Height;
   IconBitmapImage.Bitmap.Canvas.Draw(0, 0, Application.Icon);
   IconBitmapImage.Width := IconBitmapImage.Bitmap.Width;
   IconBitmapImage.Height := IconBitmapImage.Bitmap.Height;
+
+  KeepSizeY := True;
 end;
 
 end.

+ 105 - 15
Projects/SetupForm.pas

@@ -2,13 +2,11 @@ unit SetupForm;
 
 {
   Inno Setup
-  Copyright (C) 1997-2010 Jordan Russell
+  Copyright (C) 1997-2019 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
   TSetupForm
-
-  $jrsoftware: issrc/Projects/SetupForm.pas,v 1.16 2010/02/02 06:59:38 jr Exp $
 }
 
 interface
@@ -25,11 +23,21 @@ type
     FBaseUnitX, FBaseUnitY: Integer;
     FRightToLeft: Boolean;
     FFlipControlsOnShow: Boolean;
+    FSizeAndCenterOnShow: Boolean;
     FControlsFlipped: Boolean;
+    FKeepSizeY: Boolean;
     procedure WMQueryEndSession(var Message: TWMQueryEndSession); message WM_QUERYENDSESSION;
   protected
+    procedure Center;
+    procedure CenterInsideControl(const Ctl: TWinControl;
+      const InsideClientArea: Boolean);
+    procedure CenterInsideRect(const InsideRect: TRect);
     procedure CreateParams(var Params: TCreateParams); override;
     procedure CreateWnd; override;
+    procedure FlipControlsIfNeeded;
+    procedure SizeAndCenterIfNeeded(const ACenterInsideControl: Boolean;
+      const CenterInsideControlCtl: TWinControl;
+      const CenterInsideControlInsideClientArea: Boolean);
     procedure VisibleChanging; override;
     procedure WndProc(var Message: TMessage); override;
   public
@@ -40,19 +48,21 @@ type
     constructor CreateNew(AOwner: TComponent; Dummy: Integer = 0); override;
     {$ENDIF}
     function CalculateButtonWidth(const ButtonCaptions: array of TSetupMessageID): Integer;
-    procedure Center;
-    procedure CenterInsideControl(const Ctl: TWinControl;
-      const InsideClientArea: Boolean);
-    procedure CenterInsideRect(const InsideRect: TRect);
-    procedure FlipControlsIfNeeded;
     procedure InitializeFont;
     function ScalePixelsX(const N: Integer): Integer;
     function ScalePixelsY(const N: Integer): Integer;
+    function ShouldSizeX: Boolean;
+    function ShouldSizeY: Boolean;
+    procedure FlipSizeAndCenterIfNeeded(const ACenterInsideControl: Boolean = False;
+      const CenterInsideControlCtl: TWinControl = nil;
+      const CenterInsideControlInsideClientArea: Boolean = False); virtual;
     property BaseUnitX: Integer read FBaseUnitX;
     property BaseUnitY: Integer read FBaseUnitY;
     property ControlsFlipped: Boolean read FControlsFlipped;
     property FlipControlsOnShow: Boolean read FFlipControlsOnShow write FFlipControlsOnShow;
+    property KeepSizeY: Boolean read FKeepSizeY write FKeepSizeY;
     property RightToLeft: Boolean read FRightToLeft;
+    property SizeAndCenterOnShow: Boolean read FSizeAndCenterOnShow write FSizeAndCenterOnShow;
   end;
 
 procedure CalculateBaseUnitsFromFont(const Font: TFont; var X, Y: Integer);
@@ -68,6 +78,7 @@ const
 implementation
 
 uses
+  Generics.Collections, UITypes,
   CmnFunc2, Main, Msgs, BidiUtils;
 
 var
@@ -240,6 +251,39 @@ begin
     Result := False;
 end;
 
+type
+  TControlAnchorsListItem = TPair<TControl, TAnchors>;
+  TControlAnchorsList = TDictionary<TControl, TAnchors>;
+  TControlAccess = class(TControl);
+
+procedure StripAndStoreCustomAnchors(const Ctl: TControl; const AnchorsList: TControlAnchorsList);
+var
+  I: Integer;
+begin
+  if Ctl.Anchors <> [akLeft, akTop] then begin
+    AnchorsList.Add(Ctl, Ctl.Anchors);
+    { Before we can set Anchors to [akLeft, akTop] (which has a special
+      'no anchors' meaning to VCL), we first need to update the Explicit*
+      properties so the control doesn't get moved back to an old position. }
+    TControlAccess(Ctl).UpdateExplicitBounds;
+    Ctl.Anchors := [akLeft, akTop];
+  end;
+
+  if Ctl is TWinControl then
+    for I := 0 to TWinControl(Ctl).ControlCount-1 do
+      StripAndStoreCustomAnchors(TWinControl(Ctl).Controls[I], AnchorsList);
+end;
+
+procedure RestoreAnchors(const Ctl: TControl; const AnchorsList: TControlAnchorsList);
+var
+  I: TControlAnchorsListItem;
+begin
+  { The order in which we restore the anchors shouldn't matter, so just
+    enumerate the list. }
+  for I in AnchorsList do
+    I.Key.Anchors := I.Value;
+end;
+
 { TSetupForm }
 
 constructor TSetupForm.Create(AOwner: TComponent);
@@ -248,6 +292,7 @@ begin
     CreateNew isn't virtual on Delphi 2 and 3 }
   FRightToLeft := LangOptions.RightToLeft;
   FFlipControlsOnShow := FRightToLeft;
+  FSizeAndCenterOnShow := True;
   inherited;
   { In Delphi 2005 and later, Position defaults to poDefaultPosOnly, but we
     don't want the form to be changing positions whenever its handle is
@@ -266,6 +311,7 @@ begin
     when TSetupForm.CreateNew is called explicitly }
   FRightToLeft := LangOptions.RightToLeft;
   FFlipControlsOnShow := FRightToLeft;
+  FSizeAndCenterOnShow := True;
   inherited;
 end;
 
@@ -355,8 +401,44 @@ begin
   end;
 end;
 
+procedure TSetupForm.SizeAndCenterIfNeeded(const ACenterInsideControl: Boolean; const CenterInsideControlCtl: TWinControl; const CenterInsideControlInsideClientArea: Boolean);
+begin
+  if FSizeAndCenterOnShow then begin
+    FSizeAndCenterOnShow := False;
+    { Apply custom initial size from script - depends on Anchors being set on all the controls }
+    if ShouldSizeX then
+      ClientWidth := MulDiv(ClientWidth, SetupHeader.WizardSizePercentX, 100);
+    if ShouldSizeY then
+      ClientHeight := MulDiv(ClientHeight, SetupHeader.WizardSizePercentY, 100);
+    { Center }
+    if ACenterInsideControl then
+      CenterInsideControl(CenterInsideControlCtl, CenterInsideControlInsideClientArea)
+    else
+      Center;
+  end;
+end;
+
+function TSetupForm.ShouldSizeX: Boolean;
+begin
+  Result := SetupHeader.WizardSizePercentX > 100;
+end;
+
+function TSetupForm.ShouldSizeY: Boolean;
+begin
+  Result := not FKeepSizeY and (SetupHeader.WizardSizePercentY > 100);
+end;
+
+procedure TSetupForm.FlipSizeAndCenterIfNeeded(const ACenterInsideControl: Boolean;
+  const CenterInsideControlCtl: TWinControl; const CenterInsideControlInsideClientArea: Boolean);
+begin
+ { Flipping must be done first because when flipping after sizing the flipping might get old info for anchors that didn't do their work yet. }
+  FlipControlsIfNeeded;
+  SizeAndCenterIfNeeded(ACenterInsideControl, CenterInsideControlCtl, CenterInsideControlInsideClientArea);
+end;
+
 procedure TSetupForm.InitializeFont;
 var
+  ControlAnchorsList: TControlAnchorsList;
   W, H: Integer;
   R: TRect;
 begin
@@ -367,12 +449,20 @@ begin
   CalculateBaseUnitsFromFont(Font, FBaseUnitX, FBaseUnitY);
 
   if (FBaseUnitX <> OrigBaseUnitX) or (FBaseUnitY <> OrigBaseUnitY) then begin
-    { Loosely based on scaling code from TForm.ReadState: }
-    NewScaleControls(Self, BaseUnitX, OrigBaseUnitX, BaseUnitY, OrigBaseUnitY);
-    R := ClientRect;
-    W := MulDiv(R.Right, FBaseUnitX, OrigBaseUnitX);
-    H := MulDiv(R.Bottom, FBaseUnitY, OrigBaseUnitY);
-    SetBounds(Left, Top, W + (Width - R.Right), H + (Height - R.Bottom));
+    ControlAnchorsList := TControlAnchorsList.Create;
+    try
+      { Custom anchors interfere with our scaling code, so strip them and restore
+        afterwards. }
+      StripAndStoreCustomAnchors(Self, ControlAnchorsList);
+      { Loosely based on scaling code from TForm.ReadState: }
+      NewScaleControls(Self, BaseUnitX, OrigBaseUnitX, BaseUnitY, OrigBaseUnitY);
+      R := ClientRect;
+      W := MulDiv(R.Right, FBaseUnitX, OrigBaseUnitX);
+      H := MulDiv(R.Bottom, FBaseUnitY, OrigBaseUnitY);
+      SetBounds(Left, Top, W + (Width - R.Right), H + (Height - R.Bottom));
+    finally
+      RestoreAnchors(Self, ControlAnchorsList);
+    end;
   end;
 end;
 
@@ -392,7 +482,7 @@ begin
   { Note: Unlike DoShow, any exceptions raised in VisibleChanging will be
     propagated out, which is what we want }
   if not Visible then
-    FlipControlsIfNeeded;
+    FlipSizeAndCenterIfNeeded;
 end;
 
 procedure TSetupForm.WMQueryEndSession(var Message: TWMQueryEndSession);

+ 5 - 1
Projects/Struct.pas

@@ -65,7 +65,8 @@ type
     {$IFNDEF UNICODE}shShowUndisplayableLanguages, {$ENDIF}shSetupLogging,
     shSignedUninstaller, shUsePreviousLanguage, shDisableWelcomePage,
     shCloseApplications, shRestartApplications, shAllowNetworkDrive,
-    shForceCloseApplications, shAppNameHasConsts, shUsePreviousPrivileges);
+    shForceCloseApplications, shAppNameHasConsts, shUsePreviousPrivileges,
+    shWizardResizable);
   TSetupLanguageDetectionMethod = (ldUILanguage, ldLocale, ldNone);
   TSetupCompressMethod = (cmStored, cmZip, cmBzip, cmLZMA, cmLZMA2);
   TSetupSalt = array[0..7] of Byte;
@@ -75,6 +76,7 @@ type
   TSetupPrivilegesRequired = (prNone, prPowerUser, prAdmin, prLowest);
   TSetupPrivilegesRequiredOverride = (proCommandLine, proDialog);
   TSetupPrivilegesRequiredOverrides = set of TSetupPrivilegesRequiredOverride;
+  TSetupWizardStyle = (wsClassic, wsModern);
 const
   SetupProcessorArchitectureNames: array[TSetupProcessorArchitecture] of String =
     ('Unknown', 'x86', 'x64', 'Itanium', 'ARM64');
@@ -102,6 +104,8 @@ type
       NumRunEntries, NumUninstallRunEntries: Integer;
     MinVersion, OnlyBelowVersion: TSetupVersionData;
     BackColor, BackColor2: Longint;
+    WizardStyle: TSetupWizardStyle;
+    WizardSizePercentX, WizardSizePercentY: Integer;
     WizardImageAlphaFormat: (afIgnored, afDefined, afPremultiplied); // Must be same as Graphics.TAlphaFormat
     PasswordHash: TSHA1Digest;
     PasswordSalt: TSetupSalt;

+ 1 - 1
Projects/Undo.pas

@@ -1249,7 +1249,7 @@ begin
       WriteSafeHeaderString(Header.AppName, AppName, SizeOf(Header.AppName));
     if Version > Header.Version then
       Header.Version := Version;
-    TUninstallLogFlags((@Header.Flags)^) := TUninstallLogFlags((@Header.Flags)^) + Flags;
+    TUninstallLogFlags((@Header.Flags)^) := TUninstallLogFlags((@Header.Flags)^) - [ufModernStyle] + Flags;
     Header.CRC := GetCRC32(Header, SizeOf(Header)-SizeOf(Longint));
     { Prior to rewriting the header with the new EndOffset value, ensure the
       records we wrote earlier are flushed to disk. This should prevent the

+ 28 - 0
Projects/UninstProgressForm.dfm

@@ -6,11 +6,17 @@ object UninstallProgressForm: TUninstallProgressForm
   Caption = 'UninstallProgressForm'
   ClientHeight = 360
   ClientWidth = 497
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Height = -11
   Font.Name = 'MS Sans Serif'
   Font.Style = []
+  OldCreateOrder = True
   Scaled = False
+  DesignSize = (
+    497
+    360)
   PixelsPerInch = 96
   TextHeight = 13
   object Bevel: TBevel
@@ -18,6 +24,7 @@ object UninstallProgressForm: TUninstallProgressForm
     Top = 313
     Width = 497
     Height = 2
+    Anchors = [akLeft, akRight, akBottom]
     Shape = bsTopLine
   end
   object CancelButton: TNewButton
@@ -25,6 +32,7 @@ object UninstallProgressForm: TUninstallProgressForm
     Top = 327
     Width = 75
     Height = 23
+    Anchors = [akRight, akBottom]
     Cancel = True
     Caption = '*'
     Enabled = False
@@ -36,15 +44,20 @@ object UninstallProgressForm: TUninstallProgressForm
     Width = 497
     Height = 313
     ActivePage = InnerPage
+    Anchors = [akLeft, akTop, akRight, akBottom]
     Color = clBtnFace
     ParentColor = False
     TabOrder = 0
     object InnerPage: TNewNotebookPage
+      DesignSize = (
+        497
+        313)
       object Bevel1: TBevel
         Left = 0
         Top = 58
         Width = 499
         Height = 3
+        Anchors = [akLeft, akTop, akRight]
         Shape = bsTopLine
       end
       object InnerNotebook: TNewNotebook
@@ -53,21 +66,28 @@ object UninstallProgressForm: TUninstallProgressForm
         Width = 489
         Height = 245
         ActivePage = InstallingPage
+        Anchors = [akLeft, akTop, akRight, akBottom]
         TabOrder = 1
         object InstallingPage: TNewNotebookPage
+          DesignSize = (
+            489
+            245)
           object ProgressBar: TNewProgressBar
             Left = 36
             Top = 56
             Width = 417
             Height = 21
+            Anchors = [akLeft, akTop, akRight]
             Min = 0
             Max = 400
+            Style = npbstNormal
           end
           object StatusLabel: TNewStaticText
             Left = 36
             Top = 12
             Width = 417
             Height = 16
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -80,14 +100,19 @@ object UninstallProgressForm: TUninstallProgressForm
         Top = 0
         Width = 497
         Height = 58
+        Anchors = [akLeft, akTop, akRight]
         BevelOuter = bvNone
         Color = clWindow
         TabOrder = 0
+        DesignSize = (
+          497
+          58)
         object WizardSmallBitmapImage: TBitmapImage
           Left = 440
           Top = 1
           Width = 55
           Height = 55
+          Anchors = [akTop, akRight]
           BackColor = clWindow
           Center = True
         end
@@ -96,6 +121,7 @@ object UninstallProgressForm: TUninstallProgressForm
           Top = 26
           Width = 389
           Height = 29
+          Anchors = [akLeft, akTop, akRight]
           AutoSize = False
           Caption = '*'
           ShowAccelChar = False
@@ -107,6 +133,7 @@ object UninstallProgressForm: TUninstallProgressForm
           Top = 10
           Width = 405
           Height = 14
+          Anchors = [akLeft, akTop, akRight]
           AutoSize = False
           Caption = '*'
           TabOrder = 0
@@ -119,6 +146,7 @@ object UninstallProgressForm: TUninstallProgressForm
     Top = 306
     Width = 5
     Height = 14
+    Anchors = [akLeft, akBottom]
     Caption = '*'
     Enabled = False
     TabOrder = 1

+ 8 - 6
Projects/UninstProgressForm.pas

@@ -2,13 +2,11 @@ unit UninstProgressForm;
 
 {
   Inno Setup
-  Copyright (C) 1997-2010 Jordan Russell
+  Copyright (C) 1997-2019 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
   Uninstaller progress form
-
-  $jrsoftware: issrc/Projects/UninstProgressForm.pas,v 1.16 2010/10/30 20:26:25 jr Exp $
 }
 
 interface
@@ -44,7 +42,7 @@ type
     { Public declarations }
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
-    procedure Initialize(const ATitle, AAppName: String);
+    procedure Initialize(const ATitle, AAppName: String; const AModernStyle: Boolean);
     procedure UpdateProgress(const AProgress, ARange: Integer);
   end;
 
@@ -92,7 +90,6 @@ begin
   SetMessageBoxCallbackFunc(UninstallMessageBoxCallback, LongInt(Self));
 
   InitializeFont;
-  Center;
 
 {$IFDEF IS_D7}
   MainPanel.ParentBackGround := False;
@@ -119,11 +116,16 @@ begin
   inherited;
 end;
 
-procedure TUninstallProgressForm.Initialize(const ATitle, AAppName: String);
+procedure TUninstallProgressForm.Initialize(const ATitle, AAppName: String; const AModernStyle: Boolean);
 begin
   Caption := ATitle;
   PageDescriptionLabel.Caption := FmtSetupMessage1(msgUninstallStatusLabel, AAppName);
   StatusLabel.Caption := FmtSetupMessage1(msgStatusUninstalling, AAppName);
+  
+  if AModernStyle then begin
+    OuterNotebook.Color := clWindow;
+    Bevel1.Visible := False;
+  end;
 end;
 
 procedure TUninstallProgressForm.CreateParams(var Params: TCreateParams);

+ 13 - 0
Projects/UninstSharedFileForm.dfm

@@ -6,11 +6,17 @@ object UninstSharedFileForm: TUninstSharedFileForm
   Caption = 'UninstSharedFileForm'
   ClientHeight = 225
   ClientWidth = 397
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Height = -11
   Font.Name = 'MS Sans Serif'
   Font.Style = []
+  OldCreateOrder = True
   Scaled = False
+  DesignSize = (
+    397
+    225)
   PixelsPerInch = 96
   TextHeight = 13
   object NoToAllButton: TNewButton
@@ -18,6 +24,7 @@ object UninstSharedFileForm: TUninstSharedFileForm
     Top = 189
     Width = 75
     Height = 23
+    Anchors = [akBottom]
     Caption = '*'
     ModalResult = 9
     TabOrder = 3
@@ -27,6 +34,7 @@ object UninstSharedFileForm: TUninstSharedFileForm
     Top = 189
     Width = 75
     Height = 23
+    Anchors = [akBottom]
     Caption = '*'
     ModalResult = 7
     TabOrder = 2
@@ -36,6 +44,7 @@ object UninstSharedFileForm: TUninstSharedFileForm
     Top = 189
     Width = 75
     Height = 23
+    Anchors = [akBottom]
     Caption = '*'
     ModalResult = 10
     TabOrder = 1
@@ -45,6 +54,7 @@ object UninstSharedFileForm: TUninstSharedFileForm
     Top = 189
     Width = 75
     Height = 23
+    Anchors = [akBottom]
     Caption = '*'
     Default = True
     ModalResult = 6
@@ -55,6 +65,7 @@ object UninstSharedFileForm: TUninstSharedFileForm
     Top = 148
     Width = 297
     Height = 21
+    Anchors = [akLeft, akTop, akRight]
     ParentColor = True
     ReadOnly = True
     TabOrder = 8
@@ -72,6 +83,7 @@ object UninstSharedFileForm: TUninstSharedFileForm
     Top = 116
     Width = 297
     Height = 21
+    Anchors = [akLeft, akTop, akRight]
     ParentColor = True
     ReadOnly = True
     TabOrder = 6
@@ -89,6 +101,7 @@ object UninstSharedFileForm: TUninstSharedFileForm
     Top = 12
     Width = 373
     Height = 97
+    Anchors = [akLeft, akTop, akRight]
     AutoSize = False
     Caption = '*'
     ShowAccelChar = False

+ 2 - 1
Projects/UninstSharedFileForm.pas

@@ -78,7 +78,6 @@ begin
   inherited;
 
   InitializeFont;
-  Center;
 
   Caption := SetupMessages[msgConfirmDeleteSharedFileTitle];
   BodyLabel.Caption := SetupMessages[msgConfirmDeleteSharedFile2];
@@ -88,6 +87,8 @@ begin
   YesToAllButton.Caption := SetupMessages[msgButtonYesToAll];
   NoButton.Caption := SetupMessages[msgButtonNo];
   NoToAllButton.Caption := SetupMessages[msgButtonNoToAll];
+
+  KeepSizeY := True;
 end;
 
 procedure TUninstSharedFileForm.CreateParams(var Params: TCreateParams);

+ 1 - 1
Projects/Uninstall.pas

@@ -95,7 +95,7 @@ end;
 procedure InitializeUninstallProgressForm;
 begin
   UninstallProgressForm := TUninstallProgressForm.Create(nil);
-  UninstallProgressForm.Initialize(Title, UninstLog.AppName);
+  UninstallProgressForm.Initialize(Title, UninstLog.AppName, ufModernStyle in UninstLog.Flags);
   if CodeRunner <> nil then begin
     try
       CodeRunner.RunProcedures('InitializeUninstallProgressForm', [''], False);

+ 118 - 1
Projects/Wizard.dfm

@@ -6,12 +6,19 @@ object WizardForm: TWizardForm
   Caption = 'WizardForm'
   ClientHeight = 360
   ClientWidth = 497
+  Color = clBtnFace
+  Font.Charset = DEFAULT_CHARSET
   Font.Color = clWindowText
   Font.Height = -11
   Font.Name = 'MS Sans Serif'
   Font.Style = []
+  OldCreateOrder = True
   Scaled = False
   OnClose = FormClose
+  OnResize = FormResize
+  DesignSize = (
+    497
+    360)
   PixelsPerInch = 96
   TextHeight = 13
   object Bevel: TBevel
@@ -19,6 +26,7 @@ object WizardForm: TWizardForm
     Top = 313
     Width = 497
     Height = 1
+    Anchors = [akLeft, akRight, akBottom]
     Shape = bsTopLine
   end
   object CancelButton: TNewButton
@@ -26,6 +34,7 @@ object WizardForm: TWizardForm
     Top = 327
     Width = 17
     Height = 23
+    Anchors = [akRight, akBottom]
     Cancel = True
     Caption = '*'
     TabOrder = 4
@@ -36,6 +45,7 @@ object WizardForm: TWizardForm
     Top = 327
     Width = 17
     Height = 23
+    Anchors = [akRight, akBottom]
     Caption = '*'
     Default = True
     TabOrder = 3
@@ -46,6 +56,7 @@ object WizardForm: TWizardForm
     Top = 327
     Width = 16
     Height = 23
+    Anchors = [akRight, akBottom]
     Caption = '*'
     TabOrder = 2
     OnClick = BackButtonClick
@@ -56,17 +67,22 @@ object WizardForm: TWizardForm
     Width = 497
     Height = 313
     ActivePage = InnerPage
+    Anchors = [akLeft, akTop, akRight, akBottom]
     Color = clBtnFace
     ParentColor = False
     TabOrder = 0
     object WelcomePage: TNewNotebookPage
       Color = clWindow
       ParentColor = False
+      DesignSize = (
+        497
+        313)
       object WizardBitmapImage: TBitmapImage
         Left = 0
         Top = 0
         Width = 164
         Height = 314
+        Anchors = [akLeft, akTop, akBottom]
         BackColor = clWindow
       end
       object WelcomeLabel2: TNewStaticText
@@ -74,6 +90,7 @@ object WizardForm: TWizardForm
         Top = 76
         Width = 301
         Height = 234
+        Anchors = [akLeft, akTop, akRight]
         AutoSize = False
         Caption = '*'
         ShowAccelChar = False
@@ -85,6 +102,7 @@ object WizardForm: TWizardForm
         Top = 16
         Width = 301
         Height = 54
+        Anchors = [akLeft, akTop, akRight]
         AutoSize = False
         Caption = '*'
         ShowAccelChar = False
@@ -93,11 +111,15 @@ object WizardForm: TWizardForm
       end
     end
     object InnerPage: TNewNotebookPage
+      DesignSize = (
+        497
+        313)
       object Bevel1: TBevel
         Left = 0
         Top = 58
         Width = 499
         Height = 1
+        Anchors = [akLeft, akTop, akRight]
         Shape = bsTopLine
       end
       object InnerNotebook: TNewNotebook
@@ -106,13 +128,18 @@ object WizardForm: TWizardForm
         Width = 417
         Height = 237
         ActivePage = LicensePage
+        Anchors = [akLeft, akTop, akRight, akBottom]
         TabOrder = 1
         object LicensePage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object LicenseNotAcceptedRadio: TNewRadioButton
             Left = 0
             Top = 216
             Width = 417
             Height = 17
+            Anchors = [akLeft, akRight, akBottom]
             Caption = '*'
             Checked = True
             TabOrder = 3
@@ -124,6 +151,7 @@ object WizardForm: TWizardForm
             Top = 196
             Width = 417
             Height = 17
+            Anchors = [akLeft, akRight, akBottom]
             Caption = '*'
             TabOrder = 2
             OnClick = LicenseAcceptedRadioClick
@@ -133,6 +161,7 @@ object WizardForm: TWizardForm
             Top = 24
             Width = 417
             Height = 161
+            Anchors = [akLeft, akTop, akRight, akBottom]
             BevelKind = bkFlat
             BorderStyle = bsNone
             ReadOnly = True
@@ -146,6 +175,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -154,11 +184,15 @@ object WizardForm: TWizardForm
           end
         end
         object PasswordPage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object PasswordEdit: TPasswordEdit
             Left = 0
             Top = 40
             Width = 265
             Height = 21
+            Anchors = [akLeft, akTop, akRight]
             TabOrder = 2
           end
           object PasswordEditLabel: TNewStaticText
@@ -166,6 +200,7 @@ object WizardForm: TWizardForm
             Top = 24
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             FocusControl = PasswordEdit
@@ -177,6 +212,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -185,11 +221,15 @@ object WizardForm: TWizardForm
           end
         end
         object InfoBeforePage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object InfoBeforeMemo: TRichEditViewer
             Left = 0
             Top = 24
             Width = 417
             Height = 205
+            Anchors = [akLeft, akTop, akRight, akBottom]
             BevelKind = bkFlat
             BorderStyle = bsNone
             ReadOnly = True
@@ -203,6 +243,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -211,11 +252,15 @@ object WizardForm: TWizardForm
           end
         end
         object UserInfoPage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object UserInfoSerialEdit: TNewEdit
             Left = 0
             Top = 120
             Width = 417
             Height = 21
+            Anchors = [akLeft, akTop, akRight]
             MaxLength = 255
             TabOrder = 5
             OnChange = UserInfoEditChange
@@ -225,6 +270,7 @@ object WizardForm: TWizardForm
             Top = 104
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             FocusControl = UserInfoSerialEdit
@@ -236,6 +282,7 @@ object WizardForm: TWizardForm
             Top = 68
             Width = 417
             Height = 21
+            Anchors = [akLeft, akTop, akRight]
             MaxLength = 255
             TabOrder = 3
             OnChange = UserInfoEditChange
@@ -245,6 +292,7 @@ object WizardForm: TWizardForm
             Top = 52
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             FocusControl = UserInfoOrgEdit
@@ -256,6 +304,7 @@ object WizardForm: TWizardForm
             Top = 16
             Width = 417
             Height = 21
+            Anchors = [akLeft, akTop, akRight]
             MaxLength = 255
             TabOrder = 1
             OnChange = UserInfoEditChange
@@ -265,6 +314,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             FocusControl = UserInfoNameEdit
@@ -273,6 +323,9 @@ object WizardForm: TWizardForm
           end
         end
         object SelectDirPage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object SelectDirBitmapImage: TBitmapImage
             Left = 0
             Top = 0
@@ -284,6 +337,7 @@ object WizardForm: TWizardForm
             Top = 216
             Width = 417
             Height = 14
+            Anchors = [akLeft, akRight, akBottom]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -295,6 +349,7 @@ object WizardForm: TWizardForm
             Top = 67
             Width = 17
             Height = 23
+            Anchors = [akTop, akRight]
             Caption = '*'
             TabOrder = 3
             OnClick = DirBrowseButtonClick
@@ -304,6 +359,7 @@ object WizardForm: TWizardForm
             Top = 68
             Width = 397
             Height = 21
+            Anchors = [akLeft, akTop, akRight]
             TabOrder = 2
             Text = 'DirEdit'
           end
@@ -312,6 +368,7 @@ object WizardForm: TWizardForm
             Top = 44
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -323,6 +380,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 373
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -331,11 +389,15 @@ object WizardForm: TWizardForm
           end
         end
         object SelectComponentsPage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object ComponentsDiskSpaceLabel: TNewStaticText
             Left = 0
             Top = 216
             Width = 417
             Height = 14
+            Anchors = [akLeft, akRight, akBottom]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -346,6 +408,7 @@ object WizardForm: TWizardForm
             Top = 48
             Width = 417
             Height = 157
+            Anchors = [akLeft, akTop, akRight, akBottom]
             Offset = 2
             OnClickCheck = ComponentsListClickCheck
             RequireRadioSelection = True
@@ -357,7 +420,7 @@ object WizardForm: TWizardForm
             Width = 417
             Height = 21
             Style = csDropDownList
-            ItemHeight = 0
+            Anchors = [akLeft, akTop, akRight]
             TabOrder = 1
             OnChange = TypesComboChange
           end
@@ -366,6 +429,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -374,6 +438,9 @@ object WizardForm: TWizardForm
           end
         end
         object SelectProgramGroupPage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object SelectGroupBitmapImage: TBitmapImage
             Left = 0
             Top = 0
@@ -385,6 +452,7 @@ object WizardForm: TWizardForm
             Top = 215
             Width = 417
             Height = 17
+            Anchors = [akLeft, akRight, akBottom]
             Caption = '*'
             TabOrder = 4
             OnClick = NoIconsCheckClick
@@ -394,6 +462,7 @@ object WizardForm: TWizardForm
             Top = 67
             Width = 17
             Height = 23
+            Anchors = [akTop, akRight]
             Caption = '*'
             TabOrder = 3
             OnClick = GroupBrowseButtonClick
@@ -403,6 +472,7 @@ object WizardForm: TWizardForm
             Top = 68
             Width = 397
             Height = 21
+            Anchors = [akLeft, akTop, akRight]
             TabOrder = 2
             Text = 'GroupEdit'
           end
@@ -411,6 +481,7 @@ object WizardForm: TWizardForm
             Top = 44
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -422,6 +493,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 373
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -430,11 +502,15 @@ object WizardForm: TWizardForm
           end
         end
         object SelectTasksPage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object TasksList: TNewCheckListBox
             Left = 0
             Top = 24
             Width = 417
             Height = 205
+            Anchors = [akLeft, akTop, akRight, akBottom]
             ParentColor = True
             RequireRadioSelection = True
             ShowLines = False
@@ -446,6 +522,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -454,11 +531,15 @@ object WizardForm: TWizardForm
           end
         end
         object ReadyPage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object ReadyMemo: TNewMemo
             Left = 0
             Top = 24
             Width = 417
             Height = 205
+            Anchors = [akLeft, akTop, akRight, akBottom]
             Color = clBtnFace
             ReadOnly = True
             ScrollBars = ssBoth
@@ -471,6 +552,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -479,6 +561,9 @@ object WizardForm: TWizardForm
           end
         end
         object PreparingPage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object PreparingErrorBitmapImage: TBitmapImage
             Left = 0
             Top = 0
@@ -491,6 +576,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 393
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -503,6 +589,7 @@ object WizardForm: TWizardForm
             Top = 28
             Width = 393
             Height = 17
+            Anchors = [akLeft, akTop, akRight]
             Caption = '*'
             Checked = True
             TabOrder = 2
@@ -514,6 +601,7 @@ object WizardForm: TWizardForm
             Top = 56
             Width = 393
             Height = 17
+            Anchors = [akLeft, akTop, akRight]
             Caption = '*'
             TabOrder = 3
             Visible = False
@@ -523,6 +611,7 @@ object WizardForm: TWizardForm
             Top = 88
             Width = 393
             Height = 145
+            Anchors = [akLeft, akTop, akRight, akBottom]
             Color = clBtnFace
             Lines.Strings = (
               'PreparingMemo')
@@ -534,11 +623,15 @@ object WizardForm: TWizardForm
           end
         end
         object InstallingPage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object FilenameLabel: TNewStaticText
             Left = 0
             Top = 16
             Width = 417
             Height = 16
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             ForceLTRReading = True
             ShowAccelChar = False
@@ -549,6 +642,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 417
             Height = 16
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             ShowAccelChar = False
             TabOrder = 0
@@ -558,17 +652,22 @@ object WizardForm: TWizardForm
             Top = 42
             Width = 417
             Height = 21
+            Anchors = [akLeft, akTop, akRight]
             Min = 0
             Max = 100
             Style = npbstNormal
           end
         end
         object InfoAfterPage: TNewNotebookPage
+          DesignSize = (
+            417
+            237)
           object InfoAfterMemo: TRichEditViewer
             Left = 0
             Top = 24
             Width = 417
             Height = 205
+            Anchors = [akLeft, akTop, akRight, akBottom]
             BevelKind = bkFlat
             BorderStyle = bsNone
             ReadOnly = True
@@ -582,6 +681,7 @@ object WizardForm: TWizardForm
             Top = 0
             Width = 417
             Height = 14
+            Anchors = [akLeft, akTop, akRight]
             AutoSize = False
             Caption = '*'
             ShowAccelChar = False
@@ -595,14 +695,19 @@ object WizardForm: TWizardForm
         Top = 0
         Width = 497
         Height = 58
+        Anchors = [akLeft, akTop, akRight]
         BevelOuter = bvNone
         Color = clWindow
         TabOrder = 0
+        DesignSize = (
+          497
+          58)
         object WizardSmallBitmapImage: TBitmapImage
           Left = 440
           Top = 0
           Width = 55
           Height = 58
+          Anchors = [akTop, akRight]
           BackColor = clWindow
         end
         object PageDescriptionLabel: TNewStaticText
@@ -610,6 +715,7 @@ object WizardForm: TWizardForm
           Top = 26
           Width = 389
           Height = 29
+          Anchors = [akLeft, akTop, akRight]
           AutoSize = False
           Caption = '*'
           ShowAccelChar = False
@@ -621,6 +727,7 @@ object WizardForm: TWizardForm
           Top = 10
           Width = 405
           Height = 14
+          Anchors = [akLeft, akTop, akRight]
           AutoSize = False
           Caption = '*'
           ShowAccelChar = False
@@ -631,11 +738,15 @@ object WizardForm: TWizardForm
     object FinishedPage: TNewNotebookPage
       Color = clWindow
       ParentColor = False
+      DesignSize = (
+        497
+        313)
       object WizardBitmapImage2: TBitmapImage
         Left = 0
         Top = 0
         Width = 164
         Height = 314
+        Anchors = [akLeft, akTop, akBottom]
         BackColor = clWindow
       end
       object RunList: TNewCheckListBox
@@ -643,6 +754,7 @@ object WizardForm: TWizardForm
         Top = 156
         Width = 301
         Height = 149
+        Anchors = [akLeft, akTop, akRight, akBottom]
         BorderStyle = bsNone
         ParentColor = True
         TabOrder = 2
@@ -654,6 +766,7 @@ object WizardForm: TWizardForm
         Top = 184
         Width = 301
         Height = 17
+        Anchors = [akLeft, akTop, akRight]
         Caption = '*'
         TabOrder = 4
         Visible = False
@@ -663,6 +776,7 @@ object WizardForm: TWizardForm
         Top = 156
         Width = 301
         Height = 17
+        Anchors = [akLeft, akTop, akRight]
         Caption = '*'
         Checked = True
         TabOrder = 3
@@ -674,6 +788,7 @@ object WizardForm: TWizardForm
         Top = 76
         Width = 301
         Height = 53
+        Anchors = [akLeft, akTop, akRight]
         AutoSize = False
         Caption = '*'
         ShowAccelChar = False
@@ -685,6 +800,7 @@ object WizardForm: TWizardForm
         Top = 16
         Width = 301
         Height = 54
+        Anchors = [akLeft, akTop, akRight]
         AutoSize = False
         Caption = '*'
         ShowAccelChar = False
@@ -698,6 +814,7 @@ object WizardForm: TWizardForm
     Top = 306
     Width = 5
     Height = 14
+    Anchors = [akLeft, akBottom]
     Caption = '*'
     Enabled = False
     ShowAccelChar = False

+ 101 - 15
Projects/Wizard.pas

@@ -2,7 +2,7 @@ unit Wizard;
 
 {
   Inno Setup
-  Copyright (C) 1997-2018 Jordan Russell
+  Copyright (C) 1997-2019 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
@@ -45,6 +45,7 @@ type
     FStyle: TWizardPageStyle;
     FWizardForm: TWizardForm;
     function GetSurface: TNewNotebookPage;
+    function GetSurfaceColor: TColor;
     function GetSurfaceHeight: Integer;
     function GetSurfaceWidth: Integer;
     procedure SetCaption(const Value: String);
@@ -66,6 +67,7 @@ type
     property Description: String read FDescription write SetDescription;
     property ID: Integer read FID;
     property Surface: TNewNotebookPage read GetSurface;
+    property SurfaceColor: TColor read GetSurfaceColor;
     property SurfaceHeight: Integer read GetSurfaceHeight;
     property SurfaceWidth: Integer read GetSurfaceWidth;
     property OnActivate: TWizardPageNotifyEvent read FOnActivate write FOnActivate;
@@ -169,6 +171,7 @@ type
     procedure UserInfoEditChange(Sender: TObject);
     procedure DirBrowseButtonClick(Sender: TObject);
     procedure GroupBrowseButtonClick(Sender: TObject);
+    procedure FormResize(Sender: TObject);
   private
     { Private declarations }
     FPageList: TList;
@@ -184,6 +187,7 @@ type
     HasLargeComponents: Boolean;
     DoneWithWizard: Boolean;
     PrepareToInstallNeedsRestart: Boolean;
+    EnableAnchorOuterPagesOnResize: Boolean;
     procedure AdjustFocus;
     procedure CalcCurrentComponentsSpace;
     procedure ChangeReadyLabel(const S: String);
@@ -231,6 +235,8 @@ type
     function PageIndexFromID(const ID: Integer): Integer;
     procedure UpdateCurPageButtonVisibility;
     procedure SetCurPage(const NewPageID: Integer);
+    procedure FlipSizeAndCenterIfNeeded(const ACenterInsideControl: Boolean;
+      const CenterInsideControlCtl: TWinControl; const CenterInsideControlInsideClientArea: Boolean); override;
     procedure UpdateRunList(const SelectedComponents, SelectedTasks: TStringList);
     function ValidateDirEdit: Boolean;
     function ValidateGroupEdit: Boolean;
@@ -562,6 +568,11 @@ begin
     Result := FOuterNotebookPage;
 end;
 
+function TWizardPage.GetSurfaceColor: TColor;
+begin
+  Result := TNewNotebook(Surface.Parent).Color;
+end;
+
 function TWizardPage.GetSurfaceHeight: Integer;
 begin
   Result := Surface.Parent.Height;
@@ -601,14 +612,14 @@ constructor TWizardForm.Create(AOwner: TComponent);
 
   procedure LoadSelectDirAndGroupImages;
 
-    procedure IconToBitmapImage(const AIcon: HICON; const Ctl: TBitmapImage);
+    procedure IconToBitmapImage(const AIcon: HICON; const Ctl: TBitmapImage; const BkColor: TColor);
     begin
       if AIcon <> 0 then begin
         try
           with Ctl.Bitmap do begin
             Width := 32;
             Height := 32;
-            Canvas.Brush.Color := clBtnFace;
+            Canvas.Brush.Color := BkColor;
             Canvas.FillRect(Rect(0, 0, 32, 32));
             DrawIconEx(Canvas.Handle, 0, 0, AIcon, 32, 32, 0, 0, DI_NORMAL);
           end;
@@ -639,14 +650,14 @@ constructor TWizardForm.Create(AOwner: TComponent);
           SizeOf(FileInfo), SHGFI_USEFILEATTRIBUTES or SHGFI_ICONLOCATION) <> 0) and
          (FileInfo.szDisplayName[0] <> #0) then
         IconToBitmapImage(ExtractIcon(HInstance, FileInfo.szDisplayName,
-          FileInfo.iIcon), SelectDirBitmapImage);
+          FileInfo.iIcon), SelectDirBitmapImage, SelectDirPage.Color);
 
       if WindowsVersionAtLeast(6, 0) then begin
         { On Windows Vista and 7, use the "Taskbar and Start Menu Properties"
           icon as there is no longer a separate icon for Start Menu folders }
         IconToBitmapImage(ExtractIcon(HInstance,
           PChar(AddBackslash(WinSystemDir) + 'shell32.dll'), 39),
-          SelectGroupBitmapImage);
+          SelectGroupBitmapImage, SelectProgramGroupPage.Color);
       end
       else begin
         Path := GetShellFolder(False, sfPrograms, False);
@@ -656,7 +667,7 @@ constructor TWizardForm.Create(AOwner: TComponent);
           if (SHGetFileInfo(PChar(Path), 0, FileInfo, SizeOf(FileInfo),
               SHGFI_ICONLOCATION) <> 0) and (FileInfo.szDisplayName[0] <> #0) then
             IconToBitmapImage(ExtractIcon(HInstance, FileInfo.szDisplayName,
-              FileInfo.iIcon), SelectGroupBitmapImage);
+              FileInfo.iIcon), SelectGroupBitmapImage, SelectProgramGroupPage.Color);
         end;
       end;
     except
@@ -719,11 +730,18 @@ begin
       WizardSmallBitmapImage.Left := WizardSmallBitmapImage.Left + (I div 2);
     end;
   end;
+
+  { Not sure why the following is needed but various things related to
+    positioning and anchoring don't work without this (you get positions of
+    page controls back as if there was no anchoring until the page handle
+    is automatically created. Cause might be related to the comment in
+    TNewNotebook.AlignControls. }
+  for I := 0 to OuterNotebook.PageCount-1 do
+    OuterNotebook.Pages[I].HandleNeeded;
+  for I := 0 to InnerNotebook.PageCount-1 do
+    InnerNotebook.Pages[I].HandleNeeded;
+
   InitializeFont;
-  if shWindowVisible in SetupHeader.Options then
-    CenterInsideControl(MainForm, True)
-  else
-    Center;
   SetFontNameSize(WelcomeLabel1.Font, LangOptions.WelcomeFontName,
     LangOptions.WelcomeFontSize, '', 12);
   WelcomeLabel1.Font.Style := [fsBold];
@@ -736,16 +754,33 @@ begin
   else
     Caption := FmtSetupMessage1(msgSetupWindowTitle, ExpandedAppName);
 
-  { Give it a minimize button if main window isn't visible }
-  if not(shWindowVisible in SetupHeader.Options) then begin
+  { Set BorderStyle and BorderIcons:
+    -WindowVisible + WizardResizable = sizeable + maximize
+    -not WindowVisible + WizardResizable = sizeable + maximize + minimize
+    -WindowVisible + not WizardResizable = dialog (.dfm default)
+    -not WindowVisible + not WizardResizable = single + minimize }
+  if not(shWindowVisible in SetupHeader.Options) or
+     (shWizardResizable in SetupHeader.Options) then begin
     { Save ClientWidth/ClientHeight and restore them after changing
-      BorderStyle. Needed for NT 3.x. }
+      BorderStyle. }
     SaveClientWidth := ClientWidth;
     SaveClientHeight := ClientHeight;
-    BorderIcons := BorderIcons + [biMinimize];
-    BorderStyle := bsSingle;
+    if not(shWindowVisible in SetupHeader.Options) then
+      BorderIcons := BorderIcons + [biMinimize];
+    if not(shWizardResizable in SetupHeader.Options) then
+      BorderStyle := bsSingle
+    else begin
+      BorderIcons := BorderIcons + [biMaximize];
+      BorderStyle := bsSizeable;
+    end;
     ClientWidth := SaveClientWidth;
     ClientHeight := SaveClientHeight;
+    if shWizardResizable in SetupHeader.Options then begin
+      EnableAnchorOuterPagesOnResize := True;
+      { Do not allow user to resize it smaller than the current size. }
+      Constraints.MinHeight := Height;
+      Constraints.MinWidth := Width;
+    end;
   end;
 
   { Position the buttons, and scale their size }
@@ -764,6 +799,12 @@ begin
   Dec(X, W1);
   BackButton.Left := X;
 
+  { Initialize wizard style }
+  if SetupHeader.WizardStyle = wsModern then begin
+    OuterNotebook.Color := clWindow;
+    Bevel1.Visible := False;
+  end;
+
   { Initialize images }
   WizardBitmapImage.Bitmap := SelectBestImage(WizardImages, WizardBitmapImage.Width, WizardBitmapImage.Height);
   WizardBitmapImage.Center := True;
@@ -1140,6 +1181,50 @@ begin
     NoIconsCheck.Visible := False;
 end;
 
+procedure TWizardForm.FormResize(Sender: TObject);
+
+  procedure AnchorOuterPage(const Page: TNewNotebookPage;
+    const BitmapImage: TBitmapImage);
+  var
+    Ctl: TControl;
+    I, NewLeft, NewWidth: Integer;
+  begin
+    if BaseUnitX = 0 then
+      InternalError('AnchorOuterPage: BaseUnitX = 0');
+
+    NewWidth := MulDiv(BitmapImage.Height, 164, 314);
+    if ControlsFlipped then
+      BitmapImage.Left := ClientWidth - NewWidth;
+    BitmapImage.Width := NewWidth;
+    for I := 0 to Page.ControlCount-1 do begin
+      Ctl := Page.Controls[I];
+      if Ctl <> BitmapImage then begin
+        NewLeft := BitmapImage.Width + ScalePixelsX(12); // 12 is space between bitmap and controls
+        Ctl.Width := ClientWidth - ScalePixelsX(20) - NewLeft; //20 is space between controls and right border
+        if not ControlsFlipped then
+          Ctl.Left := NewLeft;
+      end;
+    end;
+  end;
+
+begin
+  if EnableAnchorOuterPagesOnResize then begin
+    { WizardBitmapImage(2)'s size is already corrected by the Anchors property but
+      this doesn't keep the aspect ratio. Calculate and set new width to restore
+      the aspect ratio and update all the other controls in the page for this. }
+    AnchorOuterPage(WelcomePage, WizardBitmapImage);
+    AnchorOuterPage(FinishedPage, WizardBitmapImage2);
+  end;
+end;
+
+procedure TWizardForm.FlipSizeAndCenterIfNeeded(const ACenterInsideControl: Boolean;
+  const CenterInsideControlCtl: TWinControl; const CenterInsideControlInsideClientArea: Boolean);
+begin
+  if ShouldSizeX or ShouldSizeY then
+    EnableAnchorOuterPagesOnResize := True;
+  inherited;
+end;
+
 destructor TWizardForm.Destroy;
 begin
   FreeAndNil(PrevDeselectedComponents);
@@ -1216,6 +1301,7 @@ begin
 
   NotebookPage := TNewNotebookPage.Create(APage);
   NotebookPage.Notebook := InnerNotebook;
+  NotebookPage.HandleNeeded; { See TWizardForm.Create comment }
   APage.FID := FNextPageID;
   APage.FOuterNotebookPage := InnerPage;
   APage.FInnerNotebookPage := NotebookPage;

+ 16 - 21
license.txt

@@ -1,37 +1,32 @@
 Inno Setup License
 ==================
 
-Except where otherwise noted, all of the documentation and software included
-in the Inno Setup package is copyrighted by Jordan Russell.
+Except where otherwise noted, all of the documentation and software included in the Inno Setup
+package is copyrighted by Jordan Russell.
 
 Copyright (C) 1997-2019 Jordan Russell. All rights reserved.
 Portions Copyright (C) 2000-2019 Martijn Laan. All rights reserved.
 
-This software is provided "as-is," without any express or implied warranty.
-In no event shall the author be held liable for any damages arising from the
-use of this software.
+This software is provided "as-is," without any express or implied warranty. In no event shall the
+author be held liable for any damages arising from the use of this software.
 
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter and redistribute it,
-provided that the following conditions are met:
+Permission is granted to anyone to use this software for any purpose, including commercial
+applications, and to alter and redistribute it, provided that the following conditions are met:
 
-1. All redistributions of source code files must retain all copyright
-   notices that are currently in place, and this list of conditions without
-   modification.
+1. All redistributions of source code files must retain all copyright notices that are currently in
+   place, and this list of conditions without modification.
 
-2. All redistributions in binary form must retain all occurrences of the
-   above copyright notice and web site addresses that are currently in
-   place (for example, in the About boxes).
+2. All redistributions in binary form must retain all occurrences of the above copyright notice and
+   web site addresses that are currently in place (for example, in the About boxes).
 
-3. The origin of this software must not be misrepresented; you must not
-   claim that you wrote the original software. If you use this software to
-   distribute a product, an acknowledgment in the product documentation
-   would be appreciated but is not required.
+3. The origin of this software must not be misrepresented; you must not claim that you wrote the
+   original software. If you use this software to distribute a product, an acknowledgment in the
+   product documentation would be appreciated but is not required.
 
-4. Modified versions in source or binary form must be plainly marked as
-   such, and must not be misrepresented as being the original software.
+4. Modified versions in source or binary form must be plainly marked as such, and must not be
+   misrepresented as being the original software.
 
 
 Jordan Russell
 jr-2010 AT jrsoftware.org
-http://www.jrsoftware.org/
+http://www.jrsoftware.org/

+ 1 - 0
setup.iss

@@ -16,6 +16,7 @@ AppUpdatesURL=http://www.innosetup.com/
 VersionInfoCopyright=Copyright (C) 1997-2019 Jordan Russell. Portions Copyright (C) 2000-2019 Martijn Laan.
 AppMutex=InnoSetupCompilerAppMutex,Global\InnoSetupCompilerAppMutex
 SetupMutex=InnoSetupCompilerSetupMutex,Global\InnoSetupCompilerSetupMutex
+WizardStyle=modern
 DefaultDirName={autopf}\Inno Setup 6
 DefaultGroupName=Inno Setup 6
 PrivilegesRequiredOverridesAllowed=dialog

+ 17 - 0
whatsnew.htm

@@ -74,6 +74,21 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
   <li>Two separate installation runs that do not share the same administrative or non administrative install mode no longer count as the <a href="http://www.jrsoftware.org/is6help/index.php?topic=sameappnotes">same application</a>. This means you can now install these modes <a href="http://www.jrsoftware.org/is6help/index.php?topic=sidebyside">side-by-side</a> even if the installers share the same <tt>AppId</tt> setting (or if <tt>AppId</tt> is not set, the same <tt>AppName</tt> setting.)</li>
   <li><b>Change in default behavior:</b> To avoid entries with identical names in the <i>Add/Remove Programs</i> Control Panel applet Setup will now automatically mark the new entry with a text like &quot;Current user&quot; or &quot;64-bit&quot; when necessary during a <a href="http://www.jrsoftware.org/is6help/index.php?topic=sidebyside">side-by-side</a> installation.</a>
 </ul>
+<p><span class="head2">Resizable wizard window</span></p>
+<p>The wizard window is now optionally resizable:</p>
+<ul>
+  <li>Added new [Setup] section directive: <tt>WizardResizable</tt>. If this directive is set to <tt>yes</tt>, the user will be able to resize and maximize the main Setup wizard window.</li>
+  <li>Added new [Setup] section directive: <tt>WizardSizePercent</tt>, which can be used to increase the default size of all Setup and Uninstall wizard windows without increasing the font size.</li>
+  <li>Pascal Scripting change: Added new <tt>Anchors</tt> property to all controls and new <tt>KeepSizeY</tt> property to <tt>TSetupForm</tt> which allows you to add full support for <tt>WizardResizable</tt> and <tt>WizardSizePercent</tt> to all your custom controls, custom wizard pages and <tt>TSetupForm</tt> forms if you have any. See the <i>CodeClasses.iss</i> example script for an example. This example also shows other changes done to <tt>TSetupForm</tt>.</li>
+</ul>
+<p><span class="head2">New modern wizard style</span></p>
+<p>The wizard window now supports a more modern look:</p>
+<ul>
+  <li>Added new [Setup] section directive: <tt>WizardStyle</tt>. If this directive is set to <tt>modern</tt>, Setup and Uninstall will show a more modern look and also the defaults for <tt>WizardResizable</tt> and <tt>WizardSizePercent</tt> change to respectively <tt>yes</tt> and <tt>120,120</tt>.</li>
+  <li><b>Change in default behavior:</b> Earlier versions of Inno Setup also supported <tt>WizardStyle</tt> and if you still have <tt>WizardStyle=modern</tt> in your script (which was allowed for backward compatibility but didn't actually change anything) and don't want to new modern look, you should remove this line or change it to <tt>WizardStyle=classic</tt>.</li>
+  <li>Updated all examples and the Compiler IDE's New Script Wizard to use <tt>WizardStyle=modern</tt>.</li>
+  <li>Pascal Scripting change: Added new <tt>SurfaceColor</tt> property to the <tt>TWizardPage</tt> support class.</li>
+</ul>
 <p><span class="head2">Other changes</span></p>
 <ul>
   <li><b>Change in default behavior:</b> Starting with Inno Setup 6 there's only one version available: Unicode Inno Setup. Unicode Inno Setup has been available for 9 years but in case you have not yet updated to it: please see the <a href="http://www.jrsoftware.org/is6help/index.php?topic=unicode">Unicode Inno Setup</a> topic in the help file for more information. Basically, unless you're using [Code] to make DLL calls with string parameters you shouldn't have to make any changes to your script.</li>
@@ -86,6 +101,7 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
   <li>The compiler will now throw an error if the $f sequence is missing in a Sign Tool command instead of executing it anyway.</li>
   <li>Fix: The compiler now checks <tt>OutputBaseFileName</tt> and <tt>OutputManifestFile</tt> for bad characters even if <tt>Output</tt> is set to <tt>no</tt>.</li>
   <li>Flattened a few elements of Setup's interface for a more modern look.</li>
+  <li>The <i>Select Language</i> dialog now has more modern look, consistent with Windows 10 task dialogs and message boxes (<a href="https://i.imgur.com/bC3BNHg.png">example</a>).</li>
 </ul>
 <ul>
   <li>Compiler IDE changes:
@@ -96,6 +112,7 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
     <li>Options <i>Allow Undo after save</i> and <i>Show indentation guides</i> are now on by default for new installations.</li>
     <li>The "Compiler Output" view is now colorized. This can be turned off in the options.</li>
     <li>The "Debug Output" view now uses bold text for any entry lines such as '-- File entry --'.</li>
+    <li>The "Configure Sign Tools" window is now wider by default and also resizable.</li>
   </ul>
   </li>
   <li>Pascal Scripting changes: