How do I remove files from the application data directory on uninstall?
I have several files and folders that I create in the Application.CommonAppDataPath directory during runtime. How can I have my deployment project remove these files on uninstall?
Presently: I have a subclassed instance of System.Configuration.Install.Installer that has the Uninstall method overridden, but I can find no way to get the application data path of the original application; Application.CommonAppDataPath simply returns the path to the Microsoft Installer.
You can try to manually go into the application data directory by using the string path = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData); then grab all the files you want to delete and delete them manually.