I try to delete a file after I have read it with my NSIS installer but the file is not deleted. If the installer is still running and I try to delete the file manually I receive an error message, saying the file is still in use.
My code looks like this:
FileOpen $0 "$EXEDIR\temp\test.cfg" r
FileRead $0 $1
...
FileClose $0
Delete "$EXEDIR\temp\test.cfg" After some queries I have figured out the following: If I add a "Delete $0" between FileOpen and FileClose, the installer does now delete the file:FileOpen $0 "$EXEDIR\temp\test.cfg" r
FileRead $0 $1
...
Delete $0
FileClose $0
Delete "$EXEDIR\temp\test.cfg" Can anybody explain why the file is not deleted with the first version?