How to uninstall files/directories created by a Symbian application at runtime
This article explains how to ensure that files created by the application are removed when it is uninstalled.
S60 3rd Edition and later
Files to be deleted must be created under the application's private directory (\private\applicationSID), and will then be deleted automatically. Files that should not be deleted (for example media files that might be used by another application) should be stored in public data areas.
S60 2nd Edition and before
The FILENULL parameter can be used in the .pkg file to specify a file or directory that should be deleted during uninstallation. For example, to delete "myapp.dat" created by the application do:
"" - "!:\system\apps\myapp\myapp.dat", FN
Note that such files will not be deleted when upgrading to a later version. This ensures that files, such as .ini files, which store application preferences, are not lost in an upgrade.
Clean up executables
It is also possible (in all versions) to run a "clean-up" exe on uninstallation (or on installation) using the RR (RUNREMOVE) or RW (RUNWAITEND) parameters. RR (RUNREMOVE) sets the file to be run at remove (uninstall) time. RW (RUNWAITEND) indicates that the (system) remover should start the program and then wait until it has completed before resuming the installation.
If the number of application-created files (or their exact names) is not known, the case is a bit more complicated. As a solution, the .sis package could include a specific uninstall application that takes care of finding and removing the right files at uninstallation. Such an application can be run automatically during uninstallation as follows: