Reputation: 20394
My application setup creates a new directory for log files the app will write.
[Dirs]
Name: "{app}\log"; Permissions: users-modify
Now when it is uninstalled, I want the log files to be removed, and the log directory as well. This won't normally happen because the log files are unknown to the uninstaller and won't be deleted, and the log directory is not empty so it won't be deleted, too.
So I'm adding this to delete the files:
[UninstallDelete]
; Delete log files
Type: files; Name: "{app}\log\*.log"; Check: not IsDowngradeUninstall
Note that this should not happen on a downgrade uninstall which is determined by other code.
Now I'm confused by the Inno Setup documentation. It says that the [UninstallDelete]
items are processed last, i. e. after deleting anything that was created from other sections. Does that mean that with this code my log files will be deleted, but the log directory not? Do I still need to repeat something like this in the UninstallDelete section:
Type: dirifempty; Name: "{app}\log"
Oh, and I'd probably also need one for {app}
itself, as it couldn't have been deleted as long as 'log' was still there...
Wouldn't it be smarter if Inno Setup could order things in a way that they could actually work? Or does it already do that?
Upvotes: 2
Views: 1430
Reputation: 1590
You don't need to add deleting of the folder manually if it was created by installer.
You can run uninstaller with /LOG command line argument. You will find in log (in user's temp folder) following events:
Upvotes: 1