I am developing one app, some of my customers getting one problem while uninstalling the app, getting a random error saying that can't uninstall [app name]. this is being caused by on orphaned cron script. for this every time we have to file a case with them asking them to run a script to allow the customer to delete the job. below is the script I need to run while uninstalling the package
for (CronTrigger ct : [select id from crontrigger where state = 'Deleted']){system.abortJob(ct.id);}
Is there any way we can have an uninstall script as part of the managed package?