问题
During the installation, I need to copy some files from folder to another, how can I be sure, that this copying process was successful?
FileCopy(ExpandConstant('{src}\copy.txt'), ExpandConstant('{app}\test_success.txt'), false);
Is there any possibility to log copying process during installation.
SetupLogging
does not provide any information about copying process during the installation
Thank You in advance
回答1:
Use 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;
Use the FileCopyLogged
the same way you are using FileCopy
:
FileCopyLogged(
ExpandConstant('{src}\copy.txt'), ExpandConstant('{app}\test_success.txt'), false);
来源:https://stackoverflow.com/questions/34634167/how-to-log-file-copying-process-in-inno-setup