Catalina changes executable to non-executable on download

You could ask the dev of the app from the YouTube video what he did to f.u.c.k up his app and why he doesn’t fix it.

True, except he (like me) probably didn’t f-up his app (AFAIK), Catalina did.

Maybe it’s the .zip program in Catalina…
https://superuser.com/questions/1345755/how-to-fix-the-application-cant-be-opened-on-mac

Well, what do you know?

That is the problem, the Archive app built into Catalina. For some reason it is causing this change.
When I unzip the program with UnArchiver, it works properly and does not change the executable flag.

Crazy, eh?

Maybe this is the underlying reason to use a .dmg instead of .zip for the file, as others have mentioned.
It’s a workaround to Apple’s F-up in Catalina!!

It doesnt
My money is simply on the unzip process not applying the original flags when it unpacks.
Which is why a DMG is a better choice.

Ah. You just worked that out for yourself. Well, good, you got the answer.

[quote=463584:@Jeff Tullin]It doesnt
My money is simply on the unzip process not applying the original flags when it unpacks.[/quote]
Right. Seems like the built-in Catalina archive app is broken. You’d think there’d be a lot of talk of this issue on the ol’ 'net!

If it only affects the executable flag, then it wont affect many people given that Apple more or less insist that you use a codesigned app in a DMG or PKG.
I would not be surprised to learn that this is not so much broken as ‘by design’, in that it makes sending a malware app to a user WITHOUT code signing and notarisation, much less likely to succeed. The unzip takes the sting out of the tail, in a way that Windows cannot do, since Windows works on the file extension only to determine if something is exectuable.

The .tar format might preserve your flags. --preserve-permissions
Im pretty sure that ‘standard’ zip format doesnt store the flags.

As I said. And I said how to make a DMG easily without paid tools. DMGs includes all necessary metadata.

If you have gatekeeper active with “only accept apps from App Store and Identified devs” yes, but you can change it to “Anywhere” temporally, run your app, and return the security to that after.

[quote=463579:@Andy Broughton]Ok, well at least one other person has this issue, the person in the video I linked in the first post.

I was hoping that someone else had run into this, or at least knew more than I do about Catalina to know why it would be clearing the executable flag ONLY for downloaded apps.

I’ll keep searching…[/quote]

How do you download ? The browser may be clearing the executable flag. Try a different browser.

[quote=463566:@Andy Broughton]I’m not sure what people here mean when the ask “how do you build your app?”
I press build in Xojo and out pops an .app.
I zip it and put it on the net.[/quote]

So you don’t code-sign it or notarise it before putting it out for download? For recent macOS versions. that ain’t gonna work.

[quote=463623:@Rick Araujo]If you have gatekeeper active with “only accept apps from App Store and Identified devs” yes, but you can change it to “Anywhere” temporally, run your app, and return the security to that after.
[/quote]

Rick, what you posted is for Mojave.

Catalina offers only “App Store” and “App Store and Identified developers”.

Not under Mojave (and, I assume, later), you can’t.

At least under Mojave, in Security & Privacy it says “MPFWUpdater.app was blocked from opening because it was not from an identified developer”, and then you click the “Open anyway” button, but that’s not future-proof.

Yep. Before you enable the “Anywhere” option with: sudo spctl --master-disable

I see. It does work. Thank you for the tip. But frankly, if the user has to do all that song and dance to run a program, it precludes any serious distribution.

Sure. This is a workaround with the focus on solving few cases.

[quote=463573:@Andy Broughton]If you don’t mind, can we discuss the specifics, which I’ve detailed before? Sprvificslly, again, why Catalina changes the executable flag.

Program works fine on any version of MacOS, including Catalina.
The ONLY issue with Catalina is that when the file is downloaded, the executable flag is removed from the executable file within the .app package.
This problem only happens on Catalina.[/quote]

I just downloaded the file under Catalina from http://mindplacesupport.com/download/927/, extracted the app by simple double click.

When I double click the app, I get ‘The application “MPFWUpdater.app” can’t be opened’.

The bundle .app has it’s executable flag, but indeed, the Unix executable inside “MPFWUpdater” has lost it’s executable flag.

When I reinstate the Unix executable Execute flag, the app runs just fine.

Now comes the barking. I code signed your app with my own Apple developer certificate. Did not notarize it. Placed it on my own server.

After download under Catalina, and extracting, it does not lose the executable flag and launches fine with Catalina default setting “Allow apps downloaded from App Store and identified developers”.

Moral: if you want to distribute professional software, be professional about it, and get a proper developer contract with Apple.

FYI, the equivalent of the Finder’s Compress “foobar” command it, I believe:

ditto -ck --keepParent /path/to/my/Application.app

If you want to make Zip archives of your app.

Internally, what’s going on is that zip files store the unix permissions in a flags field.

I have some code which uses the ZipMBS classes and does this while zipping files:

magic = inputBinaryStream.ReadUInt32() // get the first 4 bytes
if (magic = &hCAFEBABE or magic = &hFEEDFACE or magic=&hFEEDFACF) and (right(name,6) <> ".dylib" and right(name,10) <>".framework") then
  flags = &h81ED4000   // this gives 755 permission when copied to OSX
else
  flags = &h81A44000 // gives 644 permissions on OSX
end if

Looks like I’ll have to give it a try, at the very least to stop everyone here from being so disgusted.
Apple people are weird. :slight_smile: