issue/2871 - Fix the framework copy and codesigining issues

Forget the other one... that one is cleaner!
This variable leaks the scope, could you add `local` to the path variables in the `install_framework` function. This should be widely supported.