https://stackoverflow.com/questions/61959208/inno-setup-deleting-folders-after-restart-during-uninstallation
To schedule file or directory deletion on restart, call RestartReplace
function with DestFile
(second) argument set to an empty string (''
).
RestartReplace(FileToDelete, '');
For directories, this works, only if they are empty. So you will have to first call RestartReplace
for all files inside the directory, which cannot be deleted.
For details, refer to WinAPI function MoveFileEx
and its MOVEFILE_DELAY_UNTIL_REBOOT
flag, which is behind the Inno Setup RestartReplace
function.
answered May 23 '20 at 5:35