The message "You do not have permission to open the application" is shown when trying to open a downloaded app

Solution 1:

In playing with the Triangulator app I found the following issues on Big Sur:

  1. When decompressing the .zip, the application contents didn't retain the execute bits. Add it back with sudo chmod -R 755 /path/to/app.
  2. Since the application was downloaded by a web browser (in my case) the quarantine bits are set on the decompressed files. Remove that with sudo xattr -dr com.apple.quarantine /path/to/app.

Once those issues are remediated then the application can be launched.

-Eric

Solution 2:

Good News / Bad News

Good news: I figured out how to solve the problem for my apps. (Spoiler Alert: The answer for me is: “Open in Rosetta”.)

Bad news: The same solution probably won’t work for everyone, if for no other reason than I believe people are seeing this on Intel Macs.

To recap:

Here is the error message that I was getting when I tried to open either of the two apps in ~/Library/Printers/:

You do not have permission to open the application

Trying something like this:

open ~/Library/Printers/Brother\ HL-2270DW\ series.app

would lead to this error:

The application cannot be opened for an unexpected reason, 
error=Error Domain=NSOSStatusErrorDomain Code=-10826 
"kLSNoLaunchPermissionErr: User doesn't have permission to launch the app 
(managed networks)" UserInfo={_LSFunction=_LSLaunchWithRunningboard, 
_LSLine=2508, NSUnderlyingError=0x7fa98a43e450 
{Error Domain=RBSRequestErrorDomain Code=5 "Launched process exited during launch." 
UserInfo={NSLocalizedFailureReason=Launched process exited during launch.}}}

which was not at all helpful.

  1. `open -a 'Brother HL-2270DW series' did not work.

  2. Trying to remove the quarantine flag didn't work

  3. There were no files that were not executable but should have been

  4. Right Click » Open did not prompt me to open it at all.

What fixed it

Setting these apps to “Open in Rosetta” immediately solved the issue.

Get Info » Open in Rosetta

I don’t know why.

Some further thoughts on how I got into this mess…

Needed Official Drivers from Brother

When I tried to install the printer, macOS was going to install it as a generic printer. I didn't want that, so I went to the Brother website and found the official Brother Downloads page for the HL-2270DW.

Now, that page only mentions compatibility with macOS 10.15, and I'm using Big Sur, but I guessed that it would work and probably just had not been updated for Big Sur yet because some companies take forever to do that.

“Did I install this .pkg using Rosetta? Does it matter?”

I use iTerm as my default terminal app, and I have it set to always open using Rosetta, which was recommended for making brew work with Big Sur on M1 macs.

As a result, anything that I do while using iTerm is done as if this is an Intel Mac.

Here’s the weird part: Lots of times when I run into a .pkg that I need to install, I have a shell script that runs sudo /usr/sbin/installer with the proper parameters. So chances are good that I installed the Brother drivers with that script.

In iTerm.

Running in Rosetta.

Does that matter? I really have no idea. It’s entirely possible that I could have installed this with the regular Installer.app and had the same experience. But the fact that I had to manually set the printer apps to run under Rosetta makes me at least wonder if that would have been true even if the Installer app had been running as an Apple Silicon process.

Conclusion: I should probably test that. I should also probably stop using my pkg installer shell script in iTerm (I might be able to use it in Terminal.app which I left to run as an Apple Silicon process).

Pro-Tip: Get Suspicious Package and set it as the default app for all .pkg files. It’s free and it’s fantastic.

One “Trick” that I used to help solve this…

I launched the app via lldb like so:

lldb ~/Library/Printers/Brother\ HL-2270DW\ series.app/Contents/MacOS/PrinterProxy

Once it was ready, I typed run and it worked. That’s what first tipped me off that “Open Using Rosetta” might solve it, once I remembered that iTerm was running under Rosetta which means that lldb was running as an Intel process.

Have an M1 Mac? Now you have another troubleshooting step to try.

Might take a while to get this one to soak in (at least for me), but clearly “Have you tried running it under Rosetta?” is another question we should ask ourselves/others when trying to diagnose issues on M1-based Macs.