在安装过程中,我需要将一些文件从一个文件夹复制到另一个文件夹,我如何确定这个复制过程是否成功?
FileCopy(ExpandConstant('{src}\copy.txt'), ExpandConstant('{app}\test_success.txt'), false);
是否有可能在安装过程中记录复制过程。
SetupLogging
不提供有关安装期间复制过程的任何信息
提前谢谢你
最佳答案
使用Log
function :
function FileCopyLogged(
const ExistingFile, NewFile: String; const FailIfExists: Boolean): Boolean;
begin
Result := FileCopy(ExistingFile, NewFile, FailIfExists);
if Result then
begin
Log(Format('Copying %s to %s succeeded', [ExistingFile, NewFile]));
end
else
begin
Log(Format('Copying %s to %s failed', [ExistingFile, NewFile]));
end;
end;
以与使用 FileCopy
相同的方式使用 FileCopyLogged
:
FileCopyLogged(
ExpandConstant('{src}\copy.txt'), ExpandConstant('{app}\test_success.txt'), false);
关于logging - 如何在 Inno Setup 中记录文件复制过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34634167/