使用FileCopy函数在Inno Setup Pascal代码中安装文件(不显示向导表单上的安装)

时间:2017-04-27 22:47:42

标签: inno-setup

如何使用FileCopy函数将文件复制到应用程序文件夹,以便它的名称不显示在安装页面上? (FilenameLabel)。

即。我想使用Inno Setup - How to hide certain filenames while installing? (FilenameLabel)

的第一个选项

1 个答案:

答案 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;