I'm writing a post-uninstall script for a managed package that will delete a set of records that are no longer used. This works fine at the moment but I want to make it capable of deleting very large numbers of records if necessary, higher than the limits imposed by Salesforce for a single transaction. Normally I'd write a batch class to handle a bulk delete like this but post-uninstall scripts don't allow this. Is there any way around this, or any other way of bulk deleting 100,000+ records from a post uninstall script?
Just schedule a batch to do the hard delete from within your post install script. Be aware though that this should have the without sharing keyword. Otherwise the post install script will fail.