issue/2871 - Fix the framework copy and codesigining issues

Forget the other one... that one is cleaner!
Could you keep the blank lines in the generated script?