【问题标题】:Inno Setup Editable/External license fileInno Setup 可编辑/外部许可文件
【发布时间】:2016-07-19 14:43:32
【问题描述】:

我想创建一个带有从外部文件加载的许可证的 Inno Setup,以便它可以编辑。这可能吗?

许可证应从安装程序 .exe 文件中排除,但位于同一文件夹/路径中。

【问题讨论】:

  • 您希望用户能够在向导中编辑许可证吗?还是您只想让安装程序从外部文件加载许可证?
  • 我想让安装程序从外部文件加载许可证。例如:我通过 CD 将安装程序提供给一个人。此人应该能够编辑许可证文件。

标签: inno-setup


【解决方案1】:

LicenseFile directive 设置为默认许可文件,以使安装程序创建“许可协议”页面。并且还有一些备用许可证,以防外部许可证不存在。

然后在InitializeWizard event function 中加载外部许可证(如果存在)。

[Setup]
LicenseFile=default_license.txt

[Code]

procedure InitializeWizard();
var
  LicenseFile: string;
begin
  LicenseFile := ExpandConstant('{src}\license.txt');
  if FileExists(LicenseFile) then
  begin
    Log(Format('%s exists, loading a license', [LicenseFile]));
    WizardForm.LicenseMemo.Lines.LoadFromFile(LicenseFile);
  end
    else
  begin
    Log(Format('%s does not exist, keeping the default license', [LicenseFile]));
  end;
end;

【讨论】:

    猜你喜欢
    • 2014-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-02
    • 2011-03-24
    • 2011-05-08
    • 1970-01-01
    相关资源
    最近更新 更多