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

Installation 如何在安装程序中显示多个许可证,installation,inno-setup,Installation,Inno Setup,我使用Inno安装程序为我的程序创建安装程序。在我的程序中,我使用第三方库,因此我必须显示每个库的许可证信息。 此外,我希望安装程序显示特定的许可证文件选择的语言。 如果我有一张许可证表格,我知道如何在许可证文件之间切换 我在谷歌上搜索了一整天,但什么也没找到 如何显示多个许可证?您可以使用CreateOutputMsgMemoPage创建一个打开备注框的页面。然后可以调整大小并添加同意/不同意框 ; Shows a new license page for the LGPL with the

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

我在谷歌上搜索了一整天,但什么也没找到


如何显示多个许可证?

您可以使用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.

通过从
[Setup]
中删除
LicenseFile
指令并将其放入
[Languages]
中,可以使每个许可证文件与语言文件匹配,如下所示:

Name: "english"; MessagesFile: "compiler:Default.isl"; LicenseFile: "English License.rtf"
Name: "chinesesimp"; MessagesFile: "compiler:Languages\ChineseSimp.isl"; LicenseFile: "Chinese SIM License.rtf"
Name: "chinesetrad"; MessagesFile: "compiler:Languages\ChineseTrad.isl"; LicenseFile: "Chinese TRA License.rtf"
etc...

希望这对我将此代码插入我的代码有所帮助。我在哪里调用了“CreateOutputMsgMemoPage”?它是在我给你的代码中调用的。您确实需要从real
InitializeWizard
调用
LGPL\u InitializeWizard