Stop installation if writing error occurs


I would like to check it there is a way to prevent users from continuing installation if error occurs?

A possible workaround would be checking %TOTALEXTFILE%:

%TOTALEXTFILE% Contains the number of files that were unpacked (this does not take account of files that could have been skipped by end users). If the extraction failed, then %TOTALEXTFILE% will be set to “0”. Thus you may use custom actions to take appropriate measures in that case.