Install file in Inno Setup Pascal code using FileCopy function (not to show the installation on wizard form)

我的未来我决定 提交于 2019-12-12 09:26:16

问题


How to copy a file using FileCopy function to the application folder, so that it's name does not display on the installing page? (FilenameLabel).

I.e. I want to use the first option of Inno Setup - How to hide certain filenames while installing? (FilenameLabel)


回答1:


Use the FileCopy function in the CurStepChanged event function:

[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;


来源:https://stackoverflow.com/questions/43669090/install-file-in-inno-setup-pascal-code-using-filecopy-function-not-to-show-the

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!