(Firebird)子安装程序完成后,在Inno Setup中安装配置文件的自定义版本 [英] Install customized version of configuration file in Inno Setup after (Firebird) subinstaller finishes
问题描述
我正在尝试使用Inno Setup将Firebird 3与我的应用程序一起安装,我需要分发自定义版本的 firebird.conf
文件以替换Firebird随附的默认版本.怎么做?以下任何选项就足够了:
I'm trying to install Firebird 3 along with my application using Inno Setup and I need to distribute a customized version of firebird.conf
file to replace the default that comes with Firebird. How to do that? Any options of the following would be enough:
-
在安装Firebird之后复制
Firebird.conf
.(我无法执行此操作,因为在运行Firebird安装之前,始终会复制[Files]
部分中添加的文件).
Copy
Firebird.conf
after Firebird is installed. (I'm not able to do that since the file added in[Files]
section is always copied before running Firebird installation).
下载Firebird的源代码,在其中添加我的 firebird.conf
并创建一个新的Firebird安装程序.(不知道从哪里获得所有必要的文件)
Download sources for Firebird, add my firebird.conf
there and create a new Firebird installer. (No idea where to get all the necessary files for this)
推荐答案
One way to install a file after installation completes is by extracting it programmatically from 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;
有关替代方法,请参见用Inno Setup中的setup子文件夹中的文件覆盖已安装的文件.
For alternatives, see Overwrite installed files with files in setup subfolder in Inno Setup.
这篇关于(Firebird)子安装程序完成后,在Inno Setup中安装配置文件的自定义版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!