How to display a larger license box in an InnoSetup installer?

后端 未结 3 1794
灰色年华
灰色年华 2020-12-16 20:10

InnoSetup by default displays the license agreement in a really tiny text area that the user can\'t make bigger in any way.

While I know most people don\'t read thes

3条回答
  •  感动是毒
    2020-12-16 21:03

    You can change the WizardForm size and rearrange the controls in it if you want to make it bigger. I made this example to show you how to change the form height for the License page.

    [Setup]
    AppName=StackOverflow large license box
    AppVersion=1.0
    CreateAppDir=no
    DisableProgramGroupPage=yes
    DefaultGroupName=My Program
    UninstallDisplayIcon={app}\MyProg.exe
    LicenseFile=license.txt
    ;OutputDir=userdocs:Inno Setup Examples Output
    
    [Code]
    
    var
      DefaultTop, 
      DefaultLeft, 
      DefaultHeight,
      DefaultBackTop, 
      DefaultNextTop, 
      DefaultCancelTop,
      DefaultBevelTop, 
      DefaultOuterHeight: Integer;
    
    const 
      LicenseHeight = 600;
    
    procedure InitializeWizard();
    begin
      DefaultTop := WizardForm.Top;
      DefaultLeft := WizardForm.Left;
      DefaultHeight := WizardForm.Height;
      DefaultBackTop := WizardForm.BackButton.Top;
      DefaultNextTop := WizardForm.NextButton.Top;
      DefaultCancelTop := WizardForm.CancelButton.Top;
      DefaultBevelTop := WizardForm.Bevel.Top;
      DefaultOuterHeight := WizardForm.OuterNotebook.Height;
    
      WizardForm.InnerPage.Height := WizardForm.InnerPage.Height + (LicenseHeight - DefaultHeight);
      WizardForm.InnerNotebook.Height :=  WizardForm.InnerNotebook.Height + (LicenseHeight - DefaultHeight);
      WizardForm.LicensePage.Height := WizardForm.LicensePage.Height + (LicenseHeight - DefaultHeight);
      WizardForm.LicenseMemo.Height := WizardForm.LicenseMemo.Height + (LicenseHeight - DefaultHeight);
      WizardForm.LicenseNotAcceptedRadio.Top := WizardForm.LicenseNotAcceptedRadio.Top + (LicenseHeight - DefaultHeight);
      WizardForm.LicenseAcceptedRadio.Top := WizardForm.LicenseAcceptedRadio.Top + (LicenseHeight - DefaultHeight);
    
    end;
    
    procedure CurPageChanged(CurPageID: Integer);
    begin
      if CurPageID = wpLicense then
      begin
        WizardForm.Top := DefaultTop - (LicenseHeight - DefaultHeight) div 2;
        WizardForm.Height := LicenseHeight;
        WizardForm.OuterNotebook.Height := WizardForm.OuterNotebook.Height + (LicenseHeight - DefaultHeight);
        WizardForm.CancelButton.Top := DefaultCancelTop + (LicenseHeight - DefaultHeight);
        WizardForm.NextButton.Top := DefaultNextTop + (LicenseHeight - DefaultHeight);
        WizardForm.BackButton.Top := DefaultBackTop + (LicenseHeight - DefaultHeight);
        WizardForm.Bevel.Top := DefaultBevelTop + (LicenseHeight - DefaultHeight);
      end
      else 
      begin
        WizardForm.Top := DefaultTop;
        WizardForm.Left := DefaultLeft;
        WizardForm.Height := DefaultHeight;
        WizardForm.OuterNotebook.Height := DefaultOuterHeight;
        WizardForm.CancelButton.Top := DefaultCancelTop;
        WizardForm.NextButton.Top := DefaultNextTop;
        WizardForm.BackButton.Top := DefaultBackTop;
        WizardForm.Bevel.Top := DefaultBevelTop;
      end;
    end;
    

    Copy it to a new iss file and provide a valid license.txt file in order to compile successfully. The script is tested with inno 5.4.0 but it should work with any 5.x.

提交回复
热议问题