如何使用FileCopy
函数将文件复制到应用程序文件夹,以便它的名称不显示在安装页面上? (FilenameLabel
)。
即。我想使用Inno Setup - How to hide certain filenames while installing? (FilenameLabel)
的第一个选项答案 0 :(得分:1)
使用CurStepChanged
event function中的FileCopy
功能:
[Files]
Source: "MyProg.exe"; Flags: dontcopy
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
begin
{ Install after installation, as then the application folder exists already }
if CurStep = ssPostInstall then
begin
Log('Installing file');
ExtractTemporaryFile('MyProg.exe');
if FileCopy(
ExpandConstant('{tmp}\MyProg.exe'), ExpandConstant('{app}\MyProg.exe'), False) then
begin
Log('File installed.');
end
else
begin
Log('Failed to install file.');
end;
end;
end;