installation - 如何在安装程序中显示多个许可证

标签 installation inno-setup

我使用Inno Setup为程序创建安装程序。在我的程序中,我使用第三方库,因此我必须显示每个库的许可证信息。
我也希望安装程序将某些许可证文件显示为所选语言。
如果我有1个许可证表格,我知道如何在许可证文件之间切换。

我整天都在google中找了东西,但是什么也没找到

如何显示多个许可证?

最佳答案

您可以使用CreateOutputMsgMemoPage创建带有备注框的页面。然后,您可以调整大小并添加同意/不同意框。

; Shows a new license page for the LGPL with the usual accept/don't acccept options
[Code]
var
  LGPLPage: TOutputMsgMemoWizardPage;
  LGPLAccept: TNewRadioButton;
  LGPLRefuse: TNewRadioButton;

procedure LGPLPageActivate(Sender: TWizardPage); forward;
procedure LGPLAcceptClick(Sender: TObject); forward;

procedure LGPL_InitializeWizard();
var 
  LGPLText: AnsiString;

begin
  // Create the page
  LGPLPage := CreateOutputMsgMemoPage(wpLicense, SetupMessage(msgWizardLicense), SetupMessage(msgLicenseLabel), CustomMessage('LGPLHeader'), '');

  // Adjust the memo and add the confirm/refuse options
  LGPLPage.RichEditViewer.Height := ScaleY(148);
  LGPLAccept := TNewRadioButton.Create(LGPLPage);
  LGPLAccept.Left := LGPLPage.RichEditViewer.Left;
  LGPLAccept.Top := LGPLPage.Surface.ClientHeight - ScaleY(41);
  LGPLAccept.Width := LGPLPage.RichEditViewer.Width;
  LGPLAccept.Parent := LGPLPage.Surface;
  LGPLAccept.Caption := SetupMessage(msgLicenseAccepted);
  LGPLRefuse := TNewRadioButton.Create(LGPLPage);
  LGPLRefuse.Left := LGPLPage.RichEditViewer.Left;
  LGPLRefuse.Top := LGPLPage.Surface.ClientHeight - ScaleY(21);
  LGPLRefuse.Width := LGPLPage.RichEditViewer.Width;
  LGPLRefuse.Parent := LGPLPage.Surface;
  LGPLRefuse.Caption := SetupMessage(msgLicenseNotAccepted);

  // Set the states and event handlers
  LGPLPage.OnActivate := @LGPLPageActivate;
  LGPLAccept.OnClick := @LGPLAcceptClick;
  LGPLRefuse.OnClick := @LGPLAcceptClick;
  LGPLRefuse.Checked := true;

  // Load the LGPL text into the new page
  ExtractTemporaryFile('lgpl-3.0.txt');
  LoadStringFromFile(ExpandConstant('{tmp}/lgpl-3.0.txt'), LGPLText);
  LGPLPage.RichEditViewer.RTFText := LGPLText;
end;

procedure LGPLPageActivate(Sender: TWizardPage);
begin
  WizardForm.NextButton.Enabled := LGPLAccept.Checked;
end;

procedure LGPLAcceptClick(Sender: TObject);
begin
  WizardForm.NextButton.Enabled := LGPLAccept.Checked;
end;

[Files]
Source: {#Common}Setups\lgpl-3.0.txt; DestDir: {app}; Flags: ignoreversion

[CustomMessages]
LGPLHeader=Please read the following License Agreement. Some components are licensed under the GNU Lesser General Public License.

关于installation - 如何在安装程序中显示多个许可证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6939091/

相关文章:

inno-setup - Windows 8 浏览网络驱动器时出错

python - 无法在 Windows 10 上安装 pdfminer.six

PHP Solr PECL 扩展安装

c - xcrun:错误:在valgrind安装过程中未安装开发人员工具错误

c# - innosetup 中的序列号

inno-setup - 防止 Inno Setup 在卸载时删除一些文件

installation - 如何在 Inno 安装脚本的 [Code] 部分设置状态消息?

installation - 在 Centos PHP7 上安装 APC

.net - WiX:.Net 3.5 先决条件

c# - 使用数据库创 build 置文件