I believe, Inno Setup schedules the temporary folder to be deleted using WinAPI function MoveFileEx
and its MOVEFILE_DELAY_UNTIL_REBOOT
flag. And that works only if you run the installer as Administrator. Are you? If not, the folder indeed stays. I do not think it's a problem, as Windows will cleanup old folders from the temp folder on its own eventually.
Calling DelTree
from the uninstaller code cannot work. If it were that easy, the uninstaller would do it. The FAQ you refer to yourself explains why:
The reason the file remains in the directory after the uninstall process has completed is that Windows does not allow running executables to delete themselves.
If you really want to solve it, what you can do is to run a new process that will try to delete the folder on the background, once the uninstaller exits. Simple cmd
process with delayed (and possibly retrying) del
command would do. For such solution see a similar question:
Unload a .NET DLL from an unmanaged process