i used custom script for close the runnning application on uninstall and clear appdata, you can find here