"Correct" way to executed (compressed) bundled executable inside macOS sandbox?

I'm writing a macOS app that bundles an executable. This executable (and some of its resources) happen to be quite large. Ideally, I could compress this executable and its resources (in a .zip or similar) and extract them at runtime to keep my app's file size down.

This doesn't seem possible because:

  1. Copying files (using every method that I know of) while in a sandboxed app to any location will result in those files being given the "quarantined" attribute, which causes macOS to refuse to launch copied executables
  2. The only way to avoid #1 is to keep executables packaged in the app's bundle, where they won't be quarantined. Downside here is that I can't compress or decompress because the app bundle is read-only.

Is there an approach I'm not aware of here that would let me have a compressed executable + resources bundled with my sandboxed app that I could successfully decompress and execute at runtime?

Post not yet marked as solved Up vote post of mattcurtis Down vote post of mattcurtis