I am running a bat file, after the installation is done CurStep = ssDone
to perform some deletion operation. if the files and folders are not found at the specified location. It is exiting silently. i want to show the message if the file does not exits or any other error occurs during deletion how can i catch the bat file errors in Inno Setup.
Batch file:
del "C:\archives\pages\*.txt"
Code:
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
ErrorCode: Integer;
begin
if CurStep = ssDone then
begin
log('Test'+ ExpandConstant('{tmp}\deletefiles.bat'))
Exec(ExpandConstant('{tmp}\deletefiles.bat'), '', '',
SW_HIDE, ewWaitUntilTerminated, ErrorCode);
log('Done')
end;
end;