Disable the gatekeeper via sudo spctl --master-disable.
Install application.
Re-enable the gatekeeper via sudo spctl --master-enable.