First, I have no local Thunderbird installation. Second, after using Thunderbird Portable the empty folder $APPDATA\Thunderbird\Profiles\
is left behind.
The code is at the moment:
TheRealEnd: ${registry::Unload} newadvsplash::stop /WAIT RMDir "$APPDATA\Mozilla\" ;=== Will only delete if empty (no /r switch) RMDir "$APPDATA\Thunderbird\" ;=== Will only delete if empty (no /r switch)
The Folder $APPDATA\Thunderbird\
will never be empty, so the last line is useless.
A solution could be:
TheRealEnd: ${registry::Unload} newadvsplash::stop /WAIT RMDir "$APPDATA\Mozilla\" ;=== Will only delete if empty (no /r switch) RMDir "$APPDATA\Thunderbird\Profiles\" ;=== Will only delete if empty (no /r switch) RMDir "$APPDATA\Thunderbird\" ;=== Will only delete if empty (no /r switch)
If an user has a local installation, the Profiles folder won't be empty and the folders will be preserved. Otherwise the folders will be removed.