I had the same problem and i figured out a solution, the problem is that the sd card has gotten corrupted. You must have umnounted the card at some time without clicking the unmount button in the phone.
There is a very simple solution for this, access the sd card through the usb storage mode, now in the card there is a folder named .android_secure, it holds all you sa card apps data, and this is the file that is corrupted.
You need to delete this folder, it'll solve your installation error problem, but you will have to reinstall all the sd card apps.
Samsung GT-S5830 Galaxy Ace
ROM: AOKP 4.2.2
Scripts: CronMod INT2EXT4+
245MHz - 800MHz, SmartassH3