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

发布于 2024-11-27 15:08:01 字数 174 浏览 1 评论 0原文

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

我在谷歌上查了一整天,但没有找到任何东西,

我怎样才能显示多个许可证?

I use the Inno Setup to create installer for my program. In my program I use third-party libraries, so I have to show license information for each of them.
also I want the installer to show certain license files to chosen language.
I know how to switch between license files if I have 1 license form.

I've looked in google for whole day but didn't find anything

how can I show several licenses?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

森林很绿却致人迷途 2024-12-04 15:08:01

您可以通过从 [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...

希望有帮助

You can make each license file match the language file by removing the LicenseFile directive from [Setup] and putting it in the [Languages] like this:

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...

Hope that helps

长亭外,古道边 2024-12-04 15:08:01

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

You can use the CreateOutputMsgMemoPage to create a page with the memo box on. You can then adjust the sizing and add the agree/disagree boxes.

; 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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文