Urgent: app is 'broken' on download!

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 346
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK
Contact:

Urgent: app is 'broken' on download!

Post by thatkeith » Sat Oct 17, 2020 1:58 pm

I have an app that I make in Mac, Win and Linux flavours. It's been going for a few years. In around the last week I've had reports from people that the Mac version, which is downloaded from my site as a zip archive, is reported as being broken and can't be used. This happens to me too when I try downloading, unzipping and trying to launch it.

The weird thing is if I zip a different app (whether a regular third-party one or a test app I made in LiveCode), upload it to the same server, then download and try to use it... it's fine!

The app that's having problems works fine when I build it. It works fine if I zip then unzip it. But if I upload and then download and expand that same zip, the app inside is declared broken!

Err... Help? [stares into the void with a slight look of panic and bewliderment]

k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 346
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK
Contact:

Re: Urgent: app is 'broken' on download!

Post by thatkeith » Sat Oct 17, 2020 3:27 pm

Still urgent! But I've unearthed a little more detail...

It seems that app translocation may be the problem. The odd thing is that some of the tricks mentioned (such as moving the file before launching) doesn't work for me. However the terminal trick of blitzing attributes does. It also works if done to the downloaded zip archive before expanding it. Whether I do it to the zip or the extracted app this works:

Code: Select all

xattr -cr /Users/thatkeith/Downloads/Exif-Fixer-Mac.zip
This is both very simple and yet FAR too nerdy for me to ask my users to do. Any ideas?
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 346
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK
Contact:

Re: Urgent: app is 'broken' on download!

Post by thatkeith » Sat Oct 17, 2020 3:57 pm

Okay, I have made a fixer app that DOES work when downloaded. It's just a single button with this in an on mouseUp handler:

Code: Select all

   answer file "Please select the Exif Fixer application"
   put "xattr -dr com.apple.quarantine" && quote & it & quote into thePath
   get shell(thePath)
But WHY has this happened? I really need to know so I can find a fix AND so I can avoid ending up like this again.
The app in question contains an embedded copy of exiftool, which it references with shell scripts when it runs. This is added with the Standalone Application Settings > Copy Files feature, so all normal stuff. It's been working perfectly well for a few years! :shock: :? :shock: :?
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Urgent: app is 'broken' on download!

Post by Klaus » Sat Oct 17, 2020 4:06 pm

Hi Keith,

can't you create a DMG for Mac users?
Mac users are used to use DMGs for "installing" an application.

DMGs do not get corrupted when downloading, at least I did not experience this in the last 20 years.


Best

Klaus

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Urgent: app is 'broken' on download!

Post by Klaus » Sat Oct 17, 2020 4:08 pm

Or are you creating the Mac version NOT on a Mac?

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 346
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK
Contact:

Re: Urgent: app is 'broken' on download!

Post by thatkeith » Sat Oct 17, 2020 4:54 pm

Hi Klaus,

First of all, good question but yes, I am making this on a Mac. :)

Second, yes, disk images are common (although plain zips are also common). But unfortunately I just tried this and it's no better. Whether I try to launch the app directly from the (read only) DMG or copy it to /Applications and run it from there, it's declared broken. I KNOW it isn't really broken as using xattr to remove the com.apple.quarantine attribute cures the problem.

It's not a corruption issue, sadly. This appears to be related to Apple's Gatekeeper 'app translocation' security moves, but I can't see how to stop triggering this. I can't even see why this started!

k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

Klaus
Posts: 13793
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Urgent: app is 'broken' on download!

Post by Klaus » Sat Oct 17, 2020 5:13 pm

Oh, I see, sorry, no more ideas...

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 346
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK
Contact:

Re: Urgent: app is 'broken' on download!

Post by thatkeith » Sat Oct 17, 2020 5:17 pm

Thanks all the same! I've just posted to the LiveCode Commercial area. I pretty much only make free stuff but I have a commercial license, perhaps this will help. :?
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Urgent: app is 'broken' on download!

Post by jacque » Sat Oct 17, 2020 5:38 pm

Sounds like you need to notarize and staple the app. Gatekeeper has become very restrictive, especially now in Catalina. And the error message is misleading, in Mojave it just said the app was from an unknown developer.

Matthias Rebbe created a tool I use. I'm not where I can look up the link right now but will look when I get back to my Mac. I hear that AppWrapper will do notarization too if you happen to have that utility.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Urgent: app is 'broken' on download!

Post by jacque » Sat Oct 17, 2020 8:25 pm

Okay, first go to this lesson: http://lessons.livecode.com/m/4071/l/11 ... c-appstore. Matthias describes how to notarize manually.

Scroll nearly to the bottom where Matthias talks about his mrSignNotarizeHelper which automates the process. There is a link there to get the tool.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 346
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK
Contact:

Re: Urgent: app is 'broken' on download!

Post by thatkeith » Sat Oct 17, 2020 9:03 pm

jacque wrote:
Sat Oct 17, 2020 5:38 pm
the error message is misleading, in Mojave it just said the app was from an unknown developer.
Just FYI, I'm currently running in Mojave. I'm waiting for my new MBP to be replaced as it died after 6 days! I've seen both error messages in this OS, and yes, it's hella misleading.

k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 346
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK
Contact:

Re: Urgent: app is 'broken' on download!

Post by thatkeith » Sat Oct 17, 2020 9:14 pm

jacque wrote:
Sat Oct 17, 2020 5:38 pm
Sounds like you need to notarize and staple the app.
Oh god.
I mean YAY! :D

I know I need to sort out codesigning, but it really seems such a convoluted mess. Matthias's instructions look superb, but oh boy there is so MUCH in that. Oh well, time to dive in.
...Tomorrow.

Oh, and *thank you* :)

k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Urgent: app is 'broken' on download!

Post by jacque » Sat Oct 17, 2020 9:35 pm

I think the "oh god" was the right response. :) The more I work with Mac and iOS apps, the harder it gets and the more I resent it. We're stuck with it though.

BTW, Matthias' notarizing tool takes away most of the pain. You do need to go to the dev portal to get an app ID, but otherwise he handles everything.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

thatkeith
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 346
Joined: Mon Mar 01, 2010 7:13 pm
Location: London, UK
Contact:

Re: Urgent: app is 'broken' on download!

Post by thatkeith » Sun Oct 18, 2020 8:51 pm

Oh god.
The tutorial requires Xcode. I can't download Xcode because it requires me to be on 10.15 but this Mac is running 10.14. It's my backup Mac that is for running a few key 32-bit applications so I'm definitely not updating it. My Catalina Mac died at 6 days old early last week and I'm probably 10 days away from it being replaced. (Custom build, dammit.) So for the moment I'm stuck, and I'm biting my tongue to keep from expressing my feelings too saltily. :shock:
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Urgent: app is 'broken' on download!

Post by jacque » Sun Oct 18, 2020 10:12 pm

You can download XCode for Mojave by going into the dev portal. You'll need version 11.3.1 if you're using LC 9.6.1. Go here: https://developer.apple.com/download/more/ and type "XCode 11.3.1" into the search box. You should see legacy versions. If you're using LC 9.6 I think you need XCode 10.1 instead.

If you don't have a Developer ID Application certificate yet, you can do that in the developer portal too; you don't need XCode for that. See section 1.5 in Matthiasi' lesson. Another way to get the certificate is through XCode, but I never use it.

You don't need to follow all those complex Terminal directions in the LC lesson, just scroll down to Addendum 3 http://lessons.livecode.com/m/4071/l/11 ... code-stack, fill out the fields as needed, and hit the Start button.

Piece of cake. Right. Yay Apple.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Mac OS”