Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
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: