inno-setup – 如何在InnoSetup安装程序中显示更大的许可证框?

前端之家收集整理的这篇文章主要介绍了inno-setup – 如何在InnoSetup安装程序中显示更大的许可证框?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
InnoSetup默认情况下会在一个非常小的文本区域中显示许可协议,用户无法以任何方式变大.

虽然我知道大多数人没有阅读这些内容,但我觉得以特别难以阅读的格式提供它是一个坏主意,并可能成为法庭辩护的一部分.

InnoSetup有没有办法在一个大的单独的窗口中显示许可证?可能是预先推出的Pascal脚本?

解决方法

如果您想使其更大,您可以更改WizardForm大小并重新排列其中的控件.我举例说明如何更改许可证页面的表单高度.
[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;

将其复制到新的iss文件并提供有效的license.txt文件,以便成功编译.该脚本使用inno 5.4.0进行测试,但它应该适用于任何5.x.

原文链接:https://www.f2er.com/delphi/101416.html

猜你在找的Delphi相关文章