问题
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:
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).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)
回答1:
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;
For alternatives, see Overwrite installed files with files in setup subfolder in Inno Setup.
来源:https://stackoverflow.com/questions/51293403/install-customized-version-of-configuration-file-in-inno-setup-after-firebird