On 25/01/2022 08:09, Sam Oxigen wrote:
> I do log number of task outcomes to inno installer/uninstaller log file
> and I keep this file for review in case of errors. I try to _delete this
> file if there is no error _after install or uninstall. I try to delete
> this file in *[DeinitializeSetup]* or *[DeinitializeUninstall]* events
> when install or uninstall respectively. However, /DeleteFile/ returns 0;
> log file deletion fails. Is there a right place or way of deleting this
> file (after successful end)? Thanks in advance.
No, the log file is opened by the installer itself and it still has
things to write into it even after the last [Code] path. Further, if
someone has requested a log then they'll want to look at it after the
installer exits, successful or otherwise. So deleting it makes no sense.
It's also not typically needed; by default the log file is written into
the user's Temp folder so it will usually be deleted eventually on its
own by the normal disk cleanup processes.