Thanks for the offer to check the script.

I found the problem was there were two code signing operations, one for the setup file and one for the exe in the setup. Changing the certificate information or turning off code signing in Project Definitions/General Information has not effect on the code signing directive for the exe, and vice-versa.

Thanks anyway.