(Firebird) 子安装程序完成后,在 Inno Setup 中安装自定义版本的配置文件

Install customized version of configuration file in Inno Setup after (Firebird) subinstaller finishes

我正在尝试使用 Inno Setup 安装 Firebird 3 和我的应用程序,我需要分发自定义版本的 firebird.conf 文件以替换 Firebird 附带的默认版本。怎么做?以下任何选项就足够了:

  1. 安装 Firebird 后复制 Firebird.conf。 (我无法这样做,因为 [Files] 部分中添加的文件总是在 运行 Firebird 安装之前被复制)。

  2. 下载 Firebird 的源代码,在其中添加我的 firebird.conf 并创建一个新的 Firebird 安装程序。 (不知道从哪里获得所有必要的文件)

安装完成后安装文件的一种方法是通过编程方式从 CurStepChanged(ssPostInstall):

中提取文件
[Files]
Source: "Firebird.conf"; Flags: dontcopy

[Code]

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssPostInstall then
  begin
    Log('Installing Firebird.conf');
    ExtractTemporaryFile('Firebird.conf');
    if not FileCopy(ExpandConstant('{tmp}\Firebird.conf'),
                    ExpandConstant('{app}\Firebird.conf'), False) then
    begin
      RaiseException('Could not install Firebird.conf');
    end;
  end;
end;

有关备选方案,请参阅 Overwrite installed files with files in setup subfolder in Inno Setup